max_stars_repo_path
stringlengths
4
286
max_stars_repo_name
stringlengths
5
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.03M
content_cleaned
stringlengths
6
1.03M
language
stringclasses
111 values
language_score
float64
0.03
1
comments
stringlengths
0
556k
edu_score
float64
0.32
5.03
edu_int_score
int64
0
5
trade_remedies_caseworker/cases/views.py
uktrade/trade-remedies-caseworker
1
10100
import itertools import json import logging import re from django.views.generic import TemplateView from django.http import HttpResponse from django.views import View from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin from django.views.decorators.csrf import csrf_exempt from django.short...
import itertools import json import logging import re from django.views.generic import TemplateView from django.http import HttpResponse from django.views import View from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin from django.views.decorators.csrf import csrf_exempt from django.short...
en
0.849241
# If this submission has an immediate ancestor, get the docs from that to mark status # we have a list of the submissions that make up a family - id, version and documents. Override this method to customize the way permissions are checked. # note: accepted and invited are mutually exclusive # for awaiting and rejected ...
1.433441
1
mmdet/models/emod_ops/ar_module.py
zhenglab/EMOD
2
10101
<reponame>zhenglab/EMOD import torch from torch import nn from mmcv.cnn.utils import constant_init, kaiming_init class SimAttention(nn.Module): def __init__(self, in_channels): super(SimAttention, self).__init__() self.conv_attn = nn.Conv2d(in_channels, 1, kernel_size=1) self.softm...
import torch from torch import nn from mmcv.cnn.utils import constant_init, kaiming_init class SimAttention(nn.Module): def __init__(self, in_channels): super(SimAttention, self).__init__() self.conv_attn = nn.Conv2d(in_channels, 1, kernel_size=1) self.softmax = nn.Softmax(dim=2) ...
en
0.707952
AR Module for EMOD. # attention # relation
2.777401
3
prayer_times_v2.py
danish09/request_api
0
10102
import json import requests from datetime import datetime from playsound import playsound tday=datetime.today().strftime('%Y-%m-%d') right_now=datetime.today().strftime('%I-%M-%p') response = requests.get("https://www.londonprayertimes.com/api/times/?format=json&key=0239f686-4423-408e-9a0c-7968a403d197&year=&mont...
import json import requests from datetime import datetime from playsound import playsound tday=datetime.today().strftime('%Y-%m-%d') right_now=datetime.today().strftime('%I-%M-%p') response = requests.get("https://www.londonprayertimes.com/api/times/?format=json&key=0239f686-4423-408e-9a0c-7968a403d197&year=&mont...
en
0.465685
#playsound('/home/danish/Downloads/adan.mp3')
3.177953
3
pokemon/pokemon_tests/test_serializers.py
pessman/pokemon_utils
1
10103
<reponame>pessman/pokemon_utils<gh_stars>1-10 import pytest from django.test import TestCase from rest_framework import serializers as drf_serializers from pokemon import models, serializers @pytest.mark.django_db class StatsSerializer(TestCase): """ Test Module for StatsSerializer """ def setUp(se...
import pytest from django.test import TestCase from rest_framework import serializers as drf_serializers from pokemon import models, serializers @pytest.mark.django_db class StatsSerializer(TestCase): """ Test Module for StatsSerializer """ def setUp(self): models.Nature.objects.create( ...
en
0.206931
Test Module for StatsSerializer
2.416547
2
sqlpuzzle/_common/argsparser.py
Dundee/python-sqlpuzzle
8
10104
<reponame>Dundee/python-sqlpuzzle<filename>sqlpuzzle/_common/argsparser.py from sqlpuzzle.exceptions import InvalidArgumentException __all__ = ('parse_args',) # pylint: disable=dangerous-default-value,keyword-arg-before-vararg def parse_args(options={}, *args, **kwds): """ Parser of arguments. dict opti...
from sqlpuzzle.exceptions import InvalidArgumentException __all__ = ('parse_args',) # pylint: disable=dangerous-default-value,keyword-arg-before-vararg def parse_args(options={}, *args, **kwds): """ Parser of arguments. dict options { int min_items: Min of required items to fold one tuple. (defa...
en
0.60909
# pylint: disable=dangerous-default-value,keyword-arg-before-vararg Parser of arguments. dict options { int min_items: Min of required items to fold one tuple. (default: 1) int max_items: Count of items in one tuple. Last `max_items-min_items` items is by default set to None. (default: ...
2.825986
3
reviewboard/webapi/tests/test_review_screenshot_comment.py
ParikhKadam/reviewboard
921
10105
<filename>reviewboard/webapi/tests/test_review_screenshot_comment.py<gh_stars>100-1000 from __future__ import unicode_literals from django.contrib.auth.models import User from djblets.webapi.errors import PERMISSION_DENIED from reviewboard.reviews.models import ScreenshotComment from reviewboard.webapi.resources impo...
<filename>reviewboard/webapi/tests/test_review_screenshot_comment.py<gh_stars>100-1000 from __future__ import unicode_literals from django.contrib.auth.models import User from djblets.webapi.errors import PERMISSION_DENIED from reviewboard.reviews.models import ScreenshotComment from reviewboard.webapi.resources impo...
en
0.915727
Sets up a review for a screenshot that includes an open issue. If `publish` is True, the review is published. The review request is always published. Returns the response from posting the comment, the review object, and the review request object. Testing the ReviewScreenshotCommentReso...
2.133939
2
qbapi/app.py
dimddev/qb
0
10106
<filename>qbapi/app.py """ Command line tool """ import asyncio from qbapi.request import create_request from qbapi.services.clients import Producer, Consumer async def spider(user_data: tuple) -> None: """spider :param user_data: :type user_data: tuple :rtype: None """ producer_queue = asy...
<filename>qbapi/app.py """ Command line tool """ import asyncio from qbapi.request import create_request from qbapi.services.clients import Producer, Consumer async def spider(user_data: tuple) -> None: """spider :param user_data: :type user_data: tuple :rtype: None """ producer_queue = asy...
en
0.510515
Command line tool spider :param user_data: :type user_data: tuple :rtype: None
2.793021
3
test/test_literal.py
hrnciar/rdflib
0
10107
import unittest import datetime import rdflib # needed for eval(repr(...)) below from rdflib.term import Literal, URIRef, _XSD_DOUBLE, bind, _XSD_BOOLEAN from rdflib.namespace import XSD def uformat(s): return s.replace("u'", "'") class TestLiteral(unittest.TestCase): def setUp(self): pass de...
import unittest import datetime import rdflib # needed for eval(repr(...)) below from rdflib.term import Literal, URIRef, _XSD_DOUBLE, bind, _XSD_BOOLEAN from rdflib.namespace import XSD def uformat(s): return s.replace("u'", "'") class TestLiteral(unittest.TestCase): def setUp(self): pass de...
en
0.646166
# needed for eval(repr(...)) below <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:foo="http://example.org/foo#"> <rdf:Description> <foo:bar>a\b</foo:bar> </rdf:Description> </rdf:RDF> # change datatype # drewp disapproves of this behavior, but it should be # represented in the ...
2.821245
3
src/messages/text/ruling.py
rkulyn/telegram-dutch-taxbot
2
10108
import telegram from emoji import emojize from .base import TextMessageBase class RulingHelpTextMessage(TextMessageBase): """ Ruling help message. Taken from: https://www.iamexpat.nl/expat-info/taxation/30-percent-ruling/requirements """ def get_text(self): message = emojize( ...
import telegram from emoji import emojize from .base import TextMessageBase class RulingHelpTextMessage(TextMessageBase): """ Ruling help message. Taken from: https://www.iamexpat.nl/expat-info/taxation/30-percent-ruling/requirements """ def get_text(self): message = emojize( ...
en
0.614473
Ruling help message. Taken from: https://www.iamexpat.nl/expat-info/taxation/30-percent-ruling/requirements Disable link preview. Add HTML tags render support.
2.89919
3
extras/20190910/code/dummy_11a/resnet18_unet_softmax_01/train.py
pyaf/severstal-steel-defect-detection
0
10109
import os os.environ['CUDA_VISIBLE_DEVICES']='0' from common import * from dataset import * from model import * def valid_augment(image, mask, infor): return image, mask, infor def train_augment(image, mask, infor): u=np.random.choice(3) if u==0: pass elif u==1: image, mask = do_...
import os os.environ['CUDA_VISIBLE_DEVICES']='0' from common import * from dataset import * from model import * def valid_augment(image, mask, infor): return image, mask, infor def train_augment(image, mask, infor): u=np.random.choice(3) if u==0: pass elif u==1: image, mask = do_...
en
0.251306
#truth_mask.append(batch[b][1]) #------------------------------------ #out_dir=None #if b==5: break #net(input) #zz=0 #--- # debug----------------------------- # debug----------------------------- #print(valid_loss) #-- end of one data loader -- #8 #[5,5,2,5] # #RandomSampler ## setup ---------------------------------...
2.501898
3
city_coord_download.py
Yuchen971/Chinese-city-level-geojson
0
10110
<gh_stars>0 import requests import os def get_json(save_dir, adcode): # 获取当前地图轮廓 base_url = 'https://geo.datav.aliyun.com/areas/bound/' + str(adcode) + '.json' full_url = 'https://geo.datav.aliyun.com/areas/bound/' + str(adcode) + '_full.json' base_r = requests.get(base_url) if base_r.status_code ==...
import requests import os def get_json(save_dir, adcode): # 获取当前地图轮廓 base_url = 'https://geo.datav.aliyun.com/areas/bound/' + str(adcode) + '.json' full_url = 'https://geo.datav.aliyun.com/areas/bound/' + str(adcode) + '_full.json' base_r = requests.get(base_url) if base_r.status_code == 200: ...
zh
0.666763
# 获取当前地图轮廓 # 获取当前地图子地图轮廓
2.861057
3
myproject/core/clusterAnalysis.py
xiaoxiansheng19/data_analysis
0
10111
<filename>myproject/core/clusterAnalysis.py # from sklearn.cluster import DBSCAN,KMeans # # # def run(data,radius=300): # res={} # # 默认参数 epsilon=0.001, min_samples=200 # epsilon = radius / 100000 # # epsilon = 0.003 # min_samples = 100 # db = DBSCAN(eps=epsilon, min_samples=min_samples) # #...
<filename>myproject/core/clusterAnalysis.py # from sklearn.cluster import DBSCAN,KMeans # # # def run(data,radius=300): # res={} # # 默认参数 epsilon=0.001, min_samples=200 # epsilon = radius / 100000 # # epsilon = 0.003 # min_samples = 100 # db = DBSCAN(eps=epsilon, min_samples=min_samples) # #...
en
0.21102
# from sklearn.cluster import DBSCAN,KMeans # # # def run(data,radius=300): # res={} # # 默认参数 epsilon=0.001, min_samples=200 # epsilon = radius / 100000 # # epsilon = 0.003 # min_samples = 100 # db = DBSCAN(eps=epsilon, min_samples=min_samples) # # eps表示两个向量可以被视作为同一个类的最大的距离 # # min_sampl...
3.171622
3
verticapy/tests/vDataFrame/test_vDF_create.py
sitingren/VerticaPy
0
10112
# (c) Copyright [2018-2021] Micro Focus or one of its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
# (c) Copyright [2018-2021] Micro Focus or one of its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
en
0.863285
# (c) Copyright [2018-2021] Micro Focus or one of its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
2.02797
2
Solutions/beta/beta_is_it_an_isogram.py
citrok25/Codewars-1
46
10113
import re from collections import Counter def is_isogram(word): if not isinstance(word, str) or word == '': return False word = {j for i,j in Counter( re.sub('[^a-z]', '', word.lower()) ).most_common() ...
import re from collections import Counter def is_isogram(word): if not isinstance(word, str) or word == '': return False word = {j for i,j in Counter( re.sub('[^a-z]', '', word.lower()) ).most_common() ...
none
1
3.72191
4
p23_Merge_k_Sorted_Lists.py
bzhou26/leetcode_sol
0
10114
<reponame>bzhou26/leetcode_sol<filename>p23_Merge_k_Sorted_Lists.py ''' - Leetcode problem: 23 - Difficulty: Hard - Brief problem description: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example: Input: [ 1->4->5, 1->3->4, 2->6 ] Output: 1->1->2->3->4->4...
''' - Leetcode problem: 23 - Difficulty: Hard - Brief problem description: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example: Input: [ 1->4->5, 1->3->4, 2->6 ] Output: 1->1->2->3->4->4->5->6 - Solution Summary: - Used Resources: --- Bo Zhou ''' # ...
en
0.699731
- Leetcode problem: 23 - Difficulty: Hard - Brief problem description: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example: Input: [ 1->4->5, 1->3->4, 2->6 ] Output: 1->1->2->3->4->4->5->6 - Solution Summary: - Used Resources: --- Bo Zhou # Definition...
3.874538
4
flocx_ui/content/flocx/views.py
whitel/flocx-ui
0
10115
from django.views import generic class IndexView(generic.TemplateView): template_name = 'project/flocx/index.html'
from django.views import generic class IndexView(generic.TemplateView): template_name = 'project/flocx/index.html'
none
1
1.249478
1
wificontrol/utils/networkstranslate.py
patrislav1/pywificontrol
1
10116
# Written by <NAME> and <NAME> <<EMAIL>> # # Copyright (c) 2016, Emlid Limited # All rights reserved. # # Redistribution and use in source and binary forms, # with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyrig...
# Written by <NAME> and <NAME> <<EMAIL>> # # Copyright (c) 2016, Emlid Limited # All rights reserved. # # Redistribution and use in source and binary forms, # with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyrig...
en
0.723333
# Written by <NAME> and <NAME> <<EMAIL>> # # Copyright (c) 2016, Emlid Limited # All rights reserved. # # Redistribution and use in source and binary forms, # with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyrig...
1.292395
1
src/LaminariaCore.py
MrKelpy/IFXG
0
10117
<reponame>MrKelpy/IFXG # -*- coding: utf-8 -*- """ This module is distributed as part of the Laminaria Core (Python Version). Get the Source Code in GitHub: https://github.com/MrKelpy/LaminariaCore The LaminariaCore is Open Source and distributed under the MIT License """ # Built-in Imports import datetime import ran...
# -*- coding: utf-8 -*- """ This module is distributed as part of the Laminaria Core (Python Version). Get the Source Code in GitHub: https://github.com/MrKelpy/LaminariaCore The LaminariaCore is Open Source and distributed under the MIT License """ # Built-in Imports import datetime import random import asyncio impo...
en
0.668702
# -*- coding: utf-8 -*- This module is distributed as part of the Laminaria Core (Python Version). Get the Source Code in GitHub: https://github.com/MrKelpy/LaminariaCore The LaminariaCore is Open Source and distributed under the MIT License # Built-in Imports # Third Party Imports # Local Application Imports ########...
2.785235
3
examples/api/default_value.py
clamdad/atom
222
10118
<filename>examples/api/default_value.py # -------------------------------------------------------------------------------------- # Copyright (c) 2013-2021, Nucleic Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. ...
<filename>examples/api/default_value.py # -------------------------------------------------------------------------------------- # Copyright (c) 2013-2021, Nucleic Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. ...
en
0.572225
# -------------------------------------------------------------------------------------- # Copyright (c) 2013-2021, Nucleic Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # --------------------------------------...
4.029145
4
linux-distro/package/nuxleus/Source/Vendor/Microsoft/IronPython-2.0.1/Lib/Kamaelia/Codec/YUV4MPEG.py
mdavid/nuxleus
1
10119
#!/usr/bin/env python # # Copyright (C) 2007 British Broadcasting Corporation and Kamaelia Contributors(1) # All Rights Reserved. # # You may only modify and redistribute this under the terms of any of the # following licenses(2): Mozilla Public License, V1.1, GNU General # Public License, V2.0, GNU Lesser General ...
#!/usr/bin/env python # # Copyright (C) 2007 British Broadcasting Corporation and Kamaelia Contributors(1) # All Rights Reserved. # # You may only modify and redistribute this under the terms of any of the # following licenses(2): Mozilla Public License, V1.1, GNU General # Public License, V2.0, GNU Lesser General ...
en
0.773649
#!/usr/bin/env python # # Copyright (C) 2007 British Broadcasting Corporation and Kamaelia Contributors(1) # All Rights Reserved. # # You may only modify and redistribute this under the terms of any of the # following licenses(2): Mozilla Public License, V1.1, GNU General # Public License, V2.0, GNU Lesser General ...
1.440109
1
project/cli/event.py
DanielGrams/gsevp
1
10120
import click from flask.cli import AppGroup from project import app, db from project.dateutils import berlin_tz from project.services.event import ( get_recurring_events, update_event_dates_with_recurrence_rule, ) event_cli = AppGroup("event") @event_cli.command("update-recurring-dates") def update_recurrin...
import click from flask.cli import AppGroup from project import app, db from project.dateutils import berlin_tz from project.services.event import ( get_recurring_events, update_event_dates_with_recurrence_rule, ) event_cli = AppGroup("event") @event_cli.command("update-recurring-dates") def update_recurrin...
en
0.748015
# Setting the timezone is neccessary for cli command
2.326978
2
test/functional/examples/test_examples.py
ymn1k/testplan
0
10121
import os import re import sys import subprocess import pytest from testplan.common.utils.path import change_directory import platform ON_WINDOWS = platform.system() == 'Windows' KNOWN_EXCEPTIONS = [ "TclError: Can't find a usable init\.tcl in the following directories:", # Matplotlib module improperly installe...
import os import re import sys import subprocess import pytest from testplan.common.utils.path import change_directory import platform ON_WINDOWS = platform.system() == 'Windows' KNOWN_EXCEPTIONS = [ "TclError: Can't find a usable init\.tcl in the following directories:", # Matplotlib module improperly installe...
en
0.421396
# Matplotlib module improperly installed. Will skip Data Science example. # Matplotlib module improperly installed. Will skip Data Science example. # Missing module sklearn. Will skip Data Science example. # Missing module Tkinter. Will skip Data Science example. # Missing module Tkinter. Will skip Data Science example...
2.130805
2
peco/template/template.py
Tikubonn/peco
0
10122
<reponame>Tikubonn/peco from io import StringIO class Template: """ this has information that parsed source code. you can get rendered text with .render() and .render_string() """ def __init__(self, sentencenode, scope): self.sentencenode = sentencenode self.scope = scope d...
from io import StringIO class Template: """ this has information that parsed source code. you can get rendered text with .render() and .render_string() """ def __init__(self, sentencenode, scope): self.sentencenode = sentencenode self.scope = scope def render(self, stream, *...
en
0.506188
this has information that parsed source code. you can get rendered text with .render() and .render_string() render template to stream with parameters. Parameters ---------- stream: io.TextIOBase this file-like object used to output. parameters: this used to rend...
3.086943
3
mtp_api/apps/credit/tests/test_views/test_credit_list/test_security_credit_list/test_credit_list_with_blank_string_filters.py
ministryofjustice/mtp-api
5
10123
<reponame>ministryofjustice/mtp-api<gh_stars>1-10 from core import getattr_path from rest_framework import status from credit.tests.test_views.test_credit_list.test_security_credit_list import SecurityCreditListTestCase class CreditListWithBlankStringFiltersTestCase(SecurityCreditListTestCase): def assertAllResp...
from core import getattr_path from rest_framework import status from credit.tests.test_views.test_credit_list.test_security_credit_list import SecurityCreditListTestCase class CreditListWithBlankStringFiltersTestCase(SecurityCreditListTestCase): def assertAllResponsesHaveBlankField(self, filters, blank_fields, e...
it
0.199817
# noqa: N802
2.326842
2
vipermonkey/core/filetype.py
lap1nou/ViperMonkey
874
10124
<reponame>lap1nou/ViperMonkey<filename>vipermonkey/core/filetype.py """ Check for Office file types ViperMonkey is a specialized engine to parse, analyze and interpret Microsoft VBA macros (Visual Basic for Applications), mainly for malware analysis. Author: <NAME> - http://www.decalage.info License: BSD, see source ...
""" Check for Office file types ViperMonkey is a specialized engine to parse, analyze and interpret Microsoft VBA macros (Visual Basic for Applications), mainly for malware analysis. Author: <NAME> - http://www.decalage.info License: BSD, see source code or documentation Project Repository: https://github.com/decala...
en
0.717827
Check for Office file types ViperMonkey is a specialized engine to parse, analyze and interpret Microsoft VBA macros (Visual Basic for Applications), mainly for malware analysis. Author: <NAME> - http://www.decalage.info License: BSD, see source code or documentation Project Repository: https://github.com/decalage2/...
1.552327
2
packs/kubernetes/tests/test_third_party_resource.py
userlocalhost2000/st2contrib
164
10125
<gh_stars>100-1000 from st2tests.base import BaseSensorTestCase from third_party_resource import ThirdPartyResource class ThirdPartyResourceTestCase(BaseSensorTestCase): sensor_cls = ThirdPartyResource def test_k8s_object_to_st2_trigger_bad_object(self): k8s_obj = { 'type': 'kanye', ...
from st2tests.base import BaseSensorTestCase from third_party_resource import ThirdPartyResource class ThirdPartyResourceTestCase(BaseSensorTestCase): sensor_cls = ThirdPartyResource def test_k8s_object_to_st2_trigger_bad_object(self): k8s_obj = { 'type': 'kanye', 'object': {...
en
0.966757
# uid missing # label missing
2.171325
2
PrometheusScrapper/scrapper.py
masterchef/webscraper
0
10126
import datetime import getpass import logging import os import pathlib import platform import re import smtplib import sys from contextlib import contextmanager from email.message import EmailMessage from functools import wraps import azure.functions as func import click import gspread import pandas as pd from apsched...
import datetime import getpass import logging import os import pathlib import platform import re import smtplib import sys from contextlib import contextmanager from email.message import EmailMessage from functools import wraps import azure.functions as func import click import gspread import pandas as pd from apsched...
en
0.705838
# Scrape each appartment in parallel # with Pool() as pool: # results = [pool.apply_async(get_availability, args=(apt,)) for apt in apartments] # for result in results: # data = result.get() # if data: # content.append(data) Returns apartment availability information # seconds # Prin...
1.943456
2
MrWorldwide.py
AnonymousHacker1279/MrWorldwide
0
10127
<filename>MrWorldwide.py from PyQt6.QtWidgets import QApplication, QWidget, QFileDialog import PyQt6.QtCore as QtCore import PyQt6.QtGui as QtGui import sys, time, json, requests, traceback, configparser, os import MrWorldwideUI, ConfigurationUI, UpdateManagerUI version = "v1.0.0" class LangTypes: ENGLISH = "English...
<filename>MrWorldwide.py from PyQt6.QtWidgets import QApplication, QWidget, QFileDialog import PyQt6.QtCore as QtCore import PyQt6.QtGui as QtGui import sys, time, json, requests, traceback, configparser, os import MrWorldwideUI, ConfigurationUI, UpdateManagerUI version = "v1.0.0" class LangTypes: ENGLISH = "English...
en
0.718133
# Store constructor arguments (re-used for processing) # Add the callback to our kwargs # Retrieve args/kwargs here; and fire processing using them # Setup resources # Set the logos and images # TODO: Custom icon # Setup button actions # Setup dropdown boxes # Open the configuration GUI # Refresh the configuration # Cl...
2.348448
2
tools/az_cli.py
google/cloud-forensics-utls
0
10128
# -*- coding: utf-8 -*- # Copyright 2020 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
# -*- coding: utf-8 -*- # Copyright 2020 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
en
0.631148
# -*- coding: utf-8 -*- # Copyright 2020 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
2.065616
2
bbio/bbio.py
timgates42/PyBBIO
102
10129
<filename>bbio/bbio.py """ PyBBIO - bbio.py Copyright (c) 2012-2015 - <NAME> <<EMAIL>> Released under the MIT license https://github.com/graycatlabs/PyBBIO """ import sys, atexit from .platform import platform_init, platform_cleanup from .common import ADDITIONAL_CLEANUP, util_init def bbio_init(): """ Pre-run...
<filename>bbio/bbio.py """ PyBBIO - bbio.py Copyright (c) 2012-2015 - <NAME> <<EMAIL>> Released under the MIT license https://github.com/graycatlabs/PyBBIO """ import sys, atexit from .platform import platform_init, platform_cleanup from .common import ADDITIONAL_CLEANUP, util_init def bbio_init(): """ Pre-run...
en
0.827744
PyBBIO - bbio.py Copyright (c) 2012-2015 - <NAME> <<EMAIL>> Released under the MIT license https://github.com/graycatlabs/PyBBIO Pre-run initialization, i.e. starting module clocks, etc. Post-run cleanup, i.e. stopping module clocks, etc. # Run user cleanup routines: # Something went wrong with one of the cleanup ro...
2.681256
3
app/models/endeavors.py
theLaborInVain/kdm-manager-api
2
10130
<gh_stars>1-10 """ The Endeavors asset collection has a number of irregular assets. Be careful writing any custom code here. """ from app.assets import endeavors from app import models class Assets(models.AssetCollection): def __init__(self, *args, **kwargs): self.root_module = endeavors ...
""" The Endeavors asset collection has a number of irregular assets. Be careful writing any custom code here. """ from app.assets import endeavors from app import models class Assets(models.AssetCollection): def __init__(self, *args, **kwargs): self.root_module = endeavors models.Asset...
en
0.886812
The Endeavors asset collection has a number of irregular assets. Be careful writing any custom code here.
1.87897
2
interface/inter5.py
CeciliaDornelas/Python
0
10131
<reponame>CeciliaDornelas/Python<gh_stars>0 import sys from PyQt5 import QtCore, QtWidgets from PyQt5.QtWidgets import QMainWindow, QLabel, QGridLayout, QWidget from PyQt5.QtCore import QSize class HelloWindow(QMainWindow): def __init__(self): QMainWindow.__init__(self) self.setMinimumSize(QSize(2...
import sys from PyQt5 import QtCore, QtWidgets from PyQt5.QtWidgets import QMainWindow, QLabel, QGridLayout, QWidget from PyQt5.QtCore import QSize class HelloWindow(QMainWindow): def __init__(self): QMainWindow.__init__(self) self.setMinimumSize(QSize(280, 120)) self.setWindowTitle("Olá, ...
none
1
3.050087
3
setup.py
notwa/scipybiteopt
0
10132
<filename>setup.py #!/usr/bin/env python import os import sys import numpy from setuptools import setup, Extension #include markdown description in pip page this_directory = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f: long_description = f....
<filename>setup.py #!/usr/bin/env python import os import sys import numpy from setuptools import setup, Extension #include markdown description in pip page this_directory = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f: long_description = f....
en
0.651005
#!/usr/bin/env python #include markdown description in pip page # https://github.com/pypa/packaging-problems/issues/84 # no sensible way to include header files by default
1.631843
2
qiskit_experiments/data_processing/__init__.py
yoshida-ryuhei/qiskit-experiments
0
10133
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
en
0.80509
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
3.03273
3
models/pointnet2_sem_seg_msg_haptic.py
yufeiwang63/Pointnet_Pointnet2_pytorch
0
10134
import torch.nn as nn import torch.nn.functional as F from haptic.Pointnet_Pointnet2_pytorch.models.pointnet2_utils import PointNetSetAbstractionMsg,PointNetFeaturePropagation class get_shared_model(nn.Module): def __init__(self, use_batch_norm, num_classes, num_input_channel=7): super(get_shared_model, s...
import torch.nn as nn import torch.nn.functional as F from haptic.Pointnet_Pointnet2_pytorch.models.pointnet2_utils import PointNetSetAbstractionMsg,PointNetFeaturePropagation class get_shared_model(nn.Module): def __init__(self, use_batch_norm, num_classes, num_input_channel=7): super(get_shared_model, s...
en
0.785908
# for normal prediction # for force prediction # this is not needed with BCElogit loss # x = F.log_softmax(x, dim=1) # this is not needed with BCElogit loss # x = F.log_softmax(x, dim=1) # return x, l4_points
2.047124
2
backend/src/notifications/admin.py
YujithIsura/request-management
3
10135
<reponame>YujithIsura/request-management from django.contrib import admin from .models import Notification admin.site.register(Notification)
from django.contrib import admin from .models import Notification admin.site.register(Notification)
none
1
1.131761
1
HoverSlam.py
GiantWaffleCode/WafflePython
13
10136
import krpc import time import math from simple_pid import PID conn = krpc.connect(name="UI Test") vessel = conn.space_center.active_vessel kerbin_frame = vessel.orbit.body.reference_frame orb_frame = vessel.orbital_reference_frame srf_frame = vessel.surface_reference_frame surface_gravity = vessel.orbit.body.surface_...
import krpc import time import math from simple_pid import PID conn = krpc.connect(name="UI Test") vessel = conn.space_center.active_vessel kerbin_frame = vessel.orbit.body.reference_frame orb_frame = vessel.orbital_reference_frame srf_frame = vessel.surface_reference_frame surface_gravity = vessel.orbit.body.surface_...
en
0.417771
# pid1.setpoint *= .98
2.345641
2
tests/unit_tests/cx_core/integration/integration_test.py
clach04/controllerx
204
10137
<gh_stars>100-1000 from cx_core import integration as integration_module from cx_core.controller import Controller def test_get_integrations(fake_controller: Controller): integrations = integration_module.get_integrations(fake_controller, {}) inteagration_names = {i.name for i in integrations} assert inte...
from cx_core import integration as integration_module from cx_core.controller import Controller def test_get_integrations(fake_controller: Controller): integrations = integration_module.get_integrations(fake_controller, {}) inteagration_names = {i.name for i in integrations} assert inteagration_names == {...
none
1
2.22558
2
asystem-adoc/src/main/template/python/script_util.py
ggear/asystem_archive
0
10138
<reponame>ggear/asystem_archive ############################################################################### # # Python script utilities as included from the cloudera-framework-assembly, # do not edit directly # ############################################################################### import os import re de...
############################################################################### # # Python script utilities as included from the cloudera-framework-assembly, # do not edit directly # ############################################################################### import os import re def qualify(path): return path...
de
0.636154
############################################################################### # # Python script utilities as included from the cloudera-framework-assembly, # do not edit directly # ###############################################################################
2.098034
2
datapackage_pipelines/web/server.py
gperonato/datapackage-pipelines
109
10139
import datetime import os from io import BytesIO import logging from functools import wraps from copy import deepcopy from collections import Counter import slugify import yaml import mistune import requests from flask import \ Blueprint, Flask, render_template, abort, send_file, make_response from flask_cors imp...
import datetime import os from io import BytesIO import logging from functools import wraps from copy import deepcopy from collections import Counter import slugify import yaml import mistune import requests from flask import \ Blueprint, Flask, render_template, abort, send_file, make_response from flask_cors imp...
en
0.88711
A decorator that can be used to protect specific views with HTTP basic access authentication. Conditional on having BASIC_AUTH_USERNAME and BASIC_AUTH_PASSWORD set as env vars. # If we have a pipeline_path, filter the pipeline ids. # can get the full details from api/raw/<path:pipeline_id> An individual pipelin...
2.152242
2
MoveSim/code/models/losses.py
tobinsouth/privacy-preserving-synthetic-mobility-data
0
10140
<gh_stars>0 # coding: utf-8 import numpy as np import torch.nn as nn class distance_loss(nn.Module): def __init__(self): with open('../data/raw/Cellular_Baselocation_baidu') as f: gpss = f.readlines() self.X = [] self.Y = [] for gps in gpss: x, y = float(gp...
# coding: utf-8 import numpy as np import torch.nn as nn class distance_loss(nn.Module): def __init__(self): with open('../data/raw/Cellular_Baselocation_baidu') as f: gpss = f.readlines() self.X = [] self.Y = [] for gps in gpss: x, y = float(gps.split()[0]...
en
0.664807
# coding: utf-8 :param x: generated sequence, batch_size * seq_len :return: :param x: generated sequence, batch_size * seq_len :return:
2.454776
2
board/game.py
petthauk/chess_ml
0
10141
import pygame as pg from pygame.locals import * import sys import board.chess_board as board w = 60 * 8 h = 60 * 8 class Game: """ Class to setup and start a game """ def __init__(self): self.b = board.Board(w, h) def get_board(self): """ Returns board :return: B...
import pygame as pg from pygame.locals import * import sys import board.chess_board as board w = 60 * 8 h = 60 * 8 class Game: """ Class to setup and start a game """ def __init__(self): self.b = board.Board(w, h) def get_board(self): """ Returns board :return: B...
en
0.85728
Class to setup and start a game Returns board :return: Board-class Where the game is created and launched :return: # While loop to show display # Quitting game # If game can continue # Pressing mouse # Launch main-function if running this script
3.537511
4
pix2pix/Dataset_util.py
Atharva-Phatak/Season-Tranfer
2
10142
#importing libraries import torch import torch.utils.data as data import os import random from PIL import Image class CreateDataset(data.Dataset): def __init__(self , imagedir , subfolder='train' , direction = 'AtoB' , flip = False , transform = None ,resize_scale = None , crop_size = None): ...
#importing libraries import torch import torch.utils.data as data import os import random from PIL import Image class CreateDataset(data.Dataset): def __init__(self , imagedir , subfolder='train' , direction = 'AtoB' , flip = False , transform = None ,resize_scale = None , crop_size = None): ...
en
0.501408
#importing libraries
2.547027
3
crslab/system/C2CRS_System.py
Zyh716/WSDM2022-C2CRS
4
10143
<filename>crslab/system/C2CRS_System.py # @Time : 2022/1/1 # @Author : <NAME> # @email : <EMAIL> import os from math import floor import torch from loguru import logger from typing import List, Dict from copy import copy, deepcopy import pickle import os import numpy import ipdb from crslab.config import...
<filename>crslab/system/C2CRS_System.py # @Time : 2022/1/1 # @Author : <NAME> # @email : <EMAIL> import os from math import floor import torch from loguru import logger from typing import List, Dict from copy import copy, deepcopy import pickle import os import numpy import ipdb from crslab.config import...
en
0.624887
# @Time : 2022/1/1 # @Author : <NAME> # @email : <EMAIL> This is the system for TGReDial model Args: opt (dict): Indicating the hyper parameters. train_dataloader (BaseDataLoader): Indicating the train dataloader of corresponding dataset. valid_dataloader (BaseDataLoader)...
2.148383
2
morepath/__init__.py
hugovk/morepath
314
10144
# flake8: noqa """This is the main public API of Morepath. Additional public APIs can be imported from the :mod:`morepath.error` and :mod:`morepath.pdbsupport` modules. For custom directive implementations that interact with core directives for grouping or subclassing purposes, or that need to use one of the Morepath ...
# flake8: noqa """This is the main public API of Morepath. Additional public APIs can be imported from the :mod:`morepath.error` and :mod:`morepath.pdbsupport` modules. For custom directive implementations that interact with core directives for grouping or subclassing purposes, or that need to use one of the Morepath ...
en
0.830472
# flake8: noqa This is the main public API of Morepath. Additional public APIs can be imported from the :mod:`morepath.error` and :mod:`morepath.pdbsupport` modules. For custom directive implementations that interact with core directives for grouping or subclassing purposes, or that need to use one of the Morepath reg...
1.188717
1
src/AuShadha/demographics/email_and_fax/dijit_fields_constants.py
GosthMan/AuShadha
46
10145
EMAIL_AND_FAX_FORM_CONSTANTS = { }
EMAIL_AND_FAX_FORM_CONSTANTS = { }
none
1
1.115755
1
marketDataRetrieval.py
amertx/Monte-Carlo-Simulation
0
10146
#Prediction model using an instance of the Monte Carlo simulation and Brownian Motion equation #import of libraries import numpy as np import pandas as pd from pandas_datareader import data as wb import matplotlib.pyplot as plt from scipy.stats import norm #ticker selection def mainFunction(tradingSymbol): data ...
#Prediction model using an instance of the Monte Carlo simulation and Brownian Motion equation #import of libraries import numpy as np import pandas as pd from pandas_datareader import data as wb import matplotlib.pyplot as plt from scipy.stats import norm #ticker selection def mainFunction(tradingSymbol): data ...
en
0.791201
#Prediction model using an instance of the Monte Carlo simulation and Brownian Motion equation #import of libraries #ticker selection #percent change of asset price #graph showing growth over time beginning from 2015 #graph of log returns of input ticker #returns are normally distributed and have a consistent mean #cal...
3.385495
3
HelloDeepSpeed/train_bert_ds.py
mrwyattii/DeepSpeedExamples
0
10147
<gh_stars>0 """ Modified version of train_bert.py that adds DeepSpeed """ import os import datetime import json import pathlib import re import string from functools import partial from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, TypeVar, Union import random import datasets import fire import ...
""" Modified version of train_bert.py that adds DeepSpeed """ import os import datetime import json import pathlib import re import string from functools import partial from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, TypeVar, Union import random import datasets import fire import logging impo...
en
0.506649
Modified version of train_bert.py that adds DeepSpeed ###################################################################### ####################### Logging Functions ############################ ###################################################################### Log messages for specified ranks only ###############...
2.194234
2
programming/leetcode/linkedLists/PalindromeLinkedList/PalindromeLinkedList.py
vamsitallapudi/Coderefer-Python-Projects
1
10148
<gh_stars>1-10 # Given a singly linked list, determine if it is a palindrome. # Definition for singly-linked list. class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next class Solution: def isPalindrome(self, head: ListNode) -> bool: fast = slow = head #...
# Given a singly linked list, determine if it is a palindrome. # Definition for singly-linked list. class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next class Solution: def isPalindrome(self, head: ListNode) -> bool: fast = slow = head # find t...
en
0.79041
# Given a singly linked list, determine if it is a palindrome. # Definition for singly-linked list. # find the mid node # reverse the second half # compare first and second half of nodes
4.010343
4
__init__.py
CloudCIX/rolly
6
10149
<reponame>CloudCIX/rolly """ Rocky is a CLI based provisioning and management tool for CloudCIX Cloud software. Rocky is designed to operate in an out of band (OOB) network, serarated from other CloudCIX networks. Rocky's purpose is to facilitate monitoring, testing, debug and recovery """ __version__ = '0.3.5'
""" Rocky is a CLI based provisioning and management tool for CloudCIX Cloud software. Rocky is designed to operate in an out of band (OOB) network, serarated from other CloudCIX networks. Rocky's purpose is to facilitate monitoring, testing, debug and recovery """ __version__ = '0.3.5'
en
0.941058
Rocky is a CLI based provisioning and management tool for CloudCIX Cloud software. Rocky is designed to operate in an out of band (OOB) network, serarated from other CloudCIX networks. Rocky's purpose is to facilitate monitoring, testing, debug and recovery
0.714859
1
calculator.py
harshitbansal373/Python-Games
0
10150
<reponame>harshitbansal373/Python-Games from tkinter import * import time root=Tk() root.title('Calculator') root.config(bg='wheat') def display(x): global s s=s+x text.set(s) def solve(): global s try: s=str(eval(text.get())) except Exception as e: text.set(e) s='' else: text.set(s) de...
from tkinter import * import time root=Tk() root.title('Calculator') root.config(bg='wheat') def display(x): global s s=s+x text.set(s) def solve(): global s try: s=str(eval(text.get())) except Exception as e: text.set(e) s='' else: text.set(s) def clear(): global s s='' text.set(...
none
1
3.568442
4
src/Main.py
OlavH96/Master
0
10151
<gh_stars>0 import glob import os import keras import tensorflow as tf from keras.models import load_model from keras.callbacks import ModelCheckpoint import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import src.util.Files as Files from src.util.ImageLoader import load_images_generator, resize...
import glob import os import keras import tensorflow as tf from keras.models import load_model from keras.callbacks import ModelCheckpoint import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import src.util.Files as Files from src.util.ImageLoader import load_images_generator, resize_image, load...
en
0.416895
# max_x = max([i.shape[0] for i in images]) # max_y = max([i.shape[1] for i in images]) # max_x, max_y = find_max_min_image_size(path = 'detected_images/*.png') # print(max_x, max_y) # 304, 298 # define the checkpoint # vae_loss(image_shape=(max_x, max_y, 3), log_var=0.5, mu=0.5) #custom_objects={'custom_vae_loss': vae...
2.071998
2
daproli/manipulation.py
ermshaua/daproli
0
10152
from .utils import _get_return_type def windowed(data, size, step=1, ret_type=None): ''' dp.windowed applies a window function to a collection of data items. Parameters ----------- :param data: an iterable collection of data :param size: the window size :param step: the window step :p...
from .utils import _get_return_type def windowed(data, size, step=1, ret_type=None): ''' dp.windowed applies a window function to a collection of data items. Parameters ----------- :param data: an iterable collection of data :param size: the window size :param step: the window step :p...
en
0.414735
dp.windowed applies a window function to a collection of data items. Parameters ----------- :param data: an iterable collection of data :param size: the window size :param step: the window step :param ret_type: if provided the used return type, otherwise ret_type(data) :return: the windowed...
3.608289
4
ambari-server/src/test/python/stacks/2.3/ATLAS/test_metadata_server.py
gcxtx/ambari
1
10153
#!/usr/bin/env python ''' Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License")...
#!/usr/bin/env python ''' Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License")...
en
0.857483
#!/usr/bin/env python Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you...
1.728014
2
Udacity P3 Additional Files/model.py
sayeayed/Udacity-Project4
0
10154
import os import csv import numpy as np from sklearn.utils import shuffle ## Read in frame data samples = [] with open('/../opt/carnd_p3/data/driving_log.csv') as csvfile: #open the log file reader = csv.reader(csvfile) #as a readable csv for line in reader: samples.append(line) #add each line of th...
import os import csv import numpy as np from sklearn.utils import shuffle ## Read in frame data samples = [] with open('/../opt/carnd_p3/data/driving_log.csv') as csvfile: #open the log file reader = csv.reader(csvfile) #as a readable csv for line in reader: samples.append(line) #add each line of th...
en
0.772373
## Read in frame data #open the log file #as a readable csv #add each line of the log file to samples # to remove table header # shuffle entire sample set before splitting into training and validation so that training isn't biased #split samples into 80% training, 20% validation #because cv2.imread() imports the image ...
3.029101
3
utils/wavelengthfit_prim.py
GeminiDRSoftware/GHOSTDR
1
10155
#!/usr/bin/env python3 """ A script containing the basic principles of the extraction primitive inner workings""" from __future__ import division, print_function from ghostdr import polyfit import numpy as pn # Firstly, let's find all the needed files fitsdir='/Users/mireland/data/ghost/cal_frames/' #Define the f...
#!/usr/bin/env python3 """ A script containing the basic principles of the extraction primitive inner workings""" from __future__ import division, print_function from ghostdr import polyfit import numpy as pn # Firstly, let's find all the needed files fitsdir='/Users/mireland/data/ghost/cal_frames/' #Define the f...
en
0.828556
#!/usr/bin/env python3 A script containing the basic principles of the extraction primitive inner workings # Firstly, let's find all the needed files #Define the files in use (NB xmod.txt and wavemod.txt should be correct) # load it in now: # Where is the default location for the model? By default it is a parameter # ...
2.45145
2
time_management/test/kronos_test.py
AyushRawal/time-management
1
10156
import unittest import datetime import kronos string_format_time = "%Y-%m-%d %H:%M:%S" date_time_str = "2020-07-19 18:14:21" class KronosTest(unittest.TestCase): def test_get_day_of_week(self): for i in range(len(kronos.week_days)): date = kronos.get_date_time_from_string(f"2020-08-{10 + i} 1...
import unittest import datetime import kronos string_format_time = "%Y-%m-%d %H:%M:%S" date_time_str = "2020-07-19 18:14:21" class KronosTest(unittest.TestCase): def test_get_day_of_week(self): for i in range(len(kronos.week_days)): date = kronos.get_date_time_from_string(f"2020-08-{10 + i} 1...
none
1
3.387139
3
mfc/mfc.py
FuelCellUAV/FC_datalogger
0
10157
##!/usr/bin/env python3 # Mass Flow Controller Arduino driver # Copyright (C) 2015 <NAME>, <NAME> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Licens...
##!/usr/bin/env python3 # Mass Flow Controller Arduino driver # Copyright (C) 2015 <NAME>, <NAME> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Licens...
en
0.757022
##!/usr/bin/env python3 # Mass Flow Controller Arduino driver # Copyright (C) 2015 <NAME>, <NAME> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, ...
2.157583
2
odm/dialects/postgresql/green.py
quantmind/pulsar-odm
16
10158
from asyncio import Future from greenlet import getcurrent import psycopg2 from psycopg2 import * # noqa from psycopg2 import extensions, OperationalError __version__ = psycopg2.__version__ def psycopg2_wait_callback(conn): """A wait callback to allow greenlet to work with Psycopg. The caller must be from...
from asyncio import Future from greenlet import getcurrent import psycopg2 from psycopg2 import * # noqa from psycopg2 import extensions, OperationalError __version__ = psycopg2.__version__ def psycopg2_wait_callback(conn): """A wait callback to allow greenlet to work with Psycopg. The caller must be from...
en
0.801586
# noqa A wait callback to allow greenlet to work with Psycopg. The caller must be from a greenlet other than the main one. :param conn: psycopg2 connection or file number This function must be invoked from a coroutine with parent, therefore invoking it from the main greenlet will raise an exception. #...
2.718807
3
test/test_replica_set_connection.py
h4ck3rm1k3/mongo-python-driver
1
10159
# Copyright 2011-2012 10gen, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
# Copyright 2011-2012 10gen, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
en
0.869281
# Copyright 2011-2012 10gen, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
1.958817
2
jqi/cmd.py
jan-g/jqi
3
10160
import argparse_helper as argparse import config_dir import sys from .editor import Editor def main(*args): if len(args) > 0: args = [args] parser = argparse.ArgumentParser() parser.add_argument("-f", dest="cfg_file", help="query save name") parser.add_argument("-x", default=False, action="st...
import argparse_helper as argparse import config_dir import sys from .editor import Editor def main(*args): if len(args) > 0: args = [args] parser = argparse.ArgumentParser() parser.add_argument("-f", dest="cfg_file", help="query save name") parser.add_argument("-x", default=False, action="st...
none
1
2.597689
3
setup.py
ASKBOT/python-import-utils
1
10161
<reponame>ASKBOT/python-import-utils import ez_setup ez_setup.use_setuptools() from setuptools import setup, find_packages import import_utils setup( name = "import-utils", version = import_utils.__version__, description = 'A module that supports simple programmatic module imports', packages = find_pa...
import ez_setup ez_setup.use_setuptools() from setuptools import setup, find_packages import import_utils setup( name = "import-utils", version = import_utils.__version__, description = 'A module that supports simple programmatic module imports', packages = find_packages(), author = 'Evgeny.Fadeev...
none
1
1.3185
1
visual_dynamics/policies/random_offset_camera_target_policy.py
alexlee-gk/visual_dynamics
30
10162
import numpy as np from visual_dynamics.policies import CameraTargetPolicy class RandomOffsetCameraTargetPolicy(CameraTargetPolicy): def __init__(self, env, target_env, camera_node_name, agent_node_name, target_node_name, height=12.0, radius=16.0, angle=(-np.pi/4, np.pi/4), tightness=0.1, hra_in...
import numpy as np from visual_dynamics.policies import CameraTargetPolicy class RandomOffsetCameraTargetPolicy(CameraTargetPolicy): def __init__(self, env, target_env, camera_node_name, agent_node_name, target_node_name, height=12.0, radius=16.0, angle=(-np.pi/4, np.pi/4), tightness=0.1, hra_in...
en
0.270382
# self.offset = self.sample_offset()
2.319897
2
Day3/Day3.py
ErAgOn-AmAnSiRoHi/Advent-of-Code-2021
0
10163
with open("inputday3.txt") as f: data = [x for x in f.read().split()] gamma = "" epsilon = "" for b in range(0, len(data[0])): one = 0 zero = 0 for c in range(0, len(data)): if data[c][b] == '0': zero += 1 else: one += 1 if zero > one: ...
with open("inputday3.txt") as f: data = [x for x in f.read().split()] gamma = "" epsilon = "" for b in range(0, len(data[0])): one = 0 zero = 0 for c in range(0, len(data)): if data[c][b] == '0': zero += 1 else: one += 1 if zero > one: ...
none
1
3.278127
3
keras2pytorch_dataset.py
MPCAICDM/MPCA
0
10164
<gh_stars>0 from __future__ import print_function from PIL import Image import os import os.path import numpy as np import sys from misc import AverageMeter from eval_accuracy import simple_accuracy if sys.version_info[0] == 2: import cPickle as pickle else: import pickle import torch.utils.data as data import...
from __future__ import print_function from PIL import Image import os import os.path import numpy as np import sys from misc import AverageMeter from eval_accuracy import simple_accuracy if sys.version_info[0] == 2: import cPickle as pickle else: import pickle import torch.utils.data as data import torch from ...
en
0.749778
# training set or test set # ndarray Args: index (int): Index Returns: tuple: (image, target) where target is index of the target class. # doing this so that it is consistent with all other datasets # to return a PIL Image #print(img.shape) # just a index # ndarray Args: ind...
2.57122
3
mir/tools/mir_repo_utils.py
fenrir-z/ymir-cmd
1
10165
import json import logging import os from typing import Optional from mir import scm from mir.tools import mir_storage def mir_check_repo_dvc_dirty(mir_root: str = ".") -> bool: names = [name for name in mir_storage.get_all_mir_paths() if os.path.isfile(os.path.join(mir_root, name))] if names: dvc_cm...
import json import logging import os from typing import Optional from mir import scm from mir.tools import mir_storage def mir_check_repo_dvc_dirty(mir_root: str = ".") -> bool: names = [name for name in mir_storage.get_all_mir_paths() if os.path.isfile(os.path.join(mir_root, name))] if names: dvc_cm...
en
0.601488
# if no mir files in this mir repo, it's clean # if clean, returns nothing # clean # git rev-parse will return non-zero code when can not find branch # and cmd.py packs non-zero return code as an error
2.219279
2
utils/edit_utils.py
ermekaitygulov/STIT
6
10166
<reponame>ermekaitygulov/STIT import argparse import math import os import pickle from typing import List import cv2 import numpy as np import torch from PIL import Image, ImageDraw, ImageFont import configs.paths_config from configs import paths_config from training.networks import SynthesisBlock def add_texts_to_...
import argparse import math import os import pickle from typing import List import cv2 import numpy as np import torch from PIL import Image, ImageDraw, ImageFont import configs.paths_config from configs import paths_config from training.networks import SynthesisBlock def add_texts_to_image_vertical(texts, pivot_im...
none
1
2.528114
3
conll_df/conll_df.py
interrogator/conll-df
27
10167
<filename>conll_df/conll_df.py import pandas as pd # UD 1.0 CONLL_COLUMNS = ['i', 'w', 'l', 'p', 'n', 'm', 'g', 'f', 'd', 'c'] # UD 2.0 CONLL_COLUMNS_V2 = ['i', 'w', 'l', 'x', 'p', 'm', 'g', 'f', 'e', 'o'] # possible morphological attributes MORPH_ATTS = ['type', 'animacy', #'gender', ...
<filename>conll_df/conll_df.py import pandas as pd # UD 1.0 CONLL_COLUMNS = ['i', 'w', 'l', 'p', 'n', 'm', 'g', 'f', 'd', 'c'] # UD 2.0 CONLL_COLUMNS_V2 = ['i', 'w', 'l', 'x', 'p', 'm', 'g', 'f', 'e', 'o'] # possible morphological attributes MORPH_ATTS = ['type', 'animacy', #'gender', ...
en
0.835032
# UD 1.0 # UD 2.0 # possible morphological attributes #'gender', Take one CONLL-U sentence and add all metadata to each row Return: str (CSV data) and dict (sent level metadata) Add governor info to a DF. Increases memory usage quite a bit. # save the original index # add g # remove i Optimised CONLL-U reader for ...
2.946643
3
scripts/postgres_to_lmdb_bars_60m.py
alexanu/atpy
24
10168
<filename>scripts/postgres_to_lmdb_bars_60m.py #!/bin/python3 import argparse import datetime import functools import logging import os import psycopg2 from dateutil.relativedelta import relativedelta from atpy.data.cache.lmdb_cache import * from atpy.data.cache.postgres_cache import BarsInPeriodProvider from atpy.d...
<filename>scripts/postgres_to_lmdb_bars_60m.py #!/bin/python3 import argparse import datetime import functools import logging import os import psycopg2 from dateutil.relativedelta import relativedelta from atpy.data.cache.lmdb_cache import * from atpy.data.cache.postgres_cache import BarsInPeriodProvider from atpy.d...
ru
0.16812
#!/bin/python3
2.1725
2
src/download_pdf.py
luccanunes/class-url-automation
1
10169
<reponame>luccanunes/class-url-automation<filename>src/download_pdf.py def download_pdf(URL): from selenium import webdriver from time import sleep URL = URL options = webdriver.ChromeOptions() options.add_experimental_option('prefs', { # Change default directory for downloads "down...
def download_pdf(URL): from selenium import webdriver from time import sleep URL = URL options = webdriver.ChromeOptions() options.add_experimental_option('prefs', { # Change default directory for downloads "download.default_directory": r"E:\coding\other\class-url-automation\src\pdf...
en
0.608473
# Change default directory for downloads # To auto download the file # It will not show PDF directly in chrome
3.155235
3
datadog_checks_dev/datadog_checks/dev/tooling/commands/env/__init__.py
vbarbaresi/integrations-core
1
10170
<reponame>vbarbaresi/integrations-core # (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import click from ..console import CONTEXT_SETTINGS from .check import check_run from .ls import ls from .prune import prune from .reload import reload_env from .she...
# (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import click from ..console import CONTEXT_SETTINGS from .check import check_run from .ls import ls from .prune import prune from .reload import reload_env from .shell import shell from .start import star...
en
0.764575
# (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE)
1.70901
2
sdk/python/pulumi_azure_nextgen/marketplace/private_store_offer.py
pulumi/pulumi-azure-nextgen
31
10171
<filename>sdk/python/pulumi_azure_nextgen/marketplace/private_store_offer.py # coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any...
<filename>sdk/python/pulumi_azure_nextgen/marketplace/private_store_offer.py # coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any...
en
0.726843
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** The privateStore offer data structure. API Version: 2020-01-01. :param str resource_name: The name of the resource. :param pulu...
1.719262
2
examples/custom_shape/stages.py
oksumoron/locust
18,336
10172
<reponame>oksumoron/locust<filename>examples/custom_shape/stages.py from locust import HttpUser, TaskSet, task, constant from locust import LoadTestShape class UserTasks(TaskSet): @task def get_root(self): self.client.get("/") class WebsiteUser(HttpUser): wait_time = constant(0.5) tasks = [U...
from locust import HttpUser, TaskSet, task, constant from locust import LoadTestShape class UserTasks(TaskSet): @task def get_root(self): self.client.get("/") class WebsiteUser(HttpUser): wait_time = constant(0.5) tasks = [UserTasks] class StagesShape(LoadTestShape): """ A simply l...
en
0.882093
A simply load test shape class that has different user and spawn_rate at different stages. Keyword arguments: stages -- A list of dicts, each representing a stage with the following keys: duration -- When this many seconds pass the test is advanced to the next stage users -- To...
2.554685
3
db/seed_ids.py
xtuyaowu/jtyd_python_spider
7
10173
# coding:utf-8 from sqlalchemy import text from db.basic_db import db_session from db.models import SeedIds from decorators.decorator import db_commit_decorator def get_seed(): """ Get all user id to be crawled :return: user ids """ return db_session.query(SeedIds).filter(text('status=0')).all() d...
# coding:utf-8 from sqlalchemy import text from db.basic_db import db_session from db.models import SeedIds from decorators.decorator import db_commit_decorator def get_seed(): """ Get all user id to be crawled :return: user ids """ return db_session.query(SeedIds).filter(text('status=0')).all() d...
en
0.87234
# coding:utf-8 Get all user id to be crawled :return: user ids Get all user id to be crawled :return: user ids Get all user id who's home pages need to be crawled :return: user ids :param uid: user id that is crawled :param result: crawling result :return: None update it if user id already exists, e...
2.511047
3
tobler/area_weighted/area_interpolate.py
sjsrey/tobler
1
10174
""" Area Weighted Interpolation """ import numpy as np import geopandas as gpd from ._vectorized_raster_interpolation import _fast_append_profile_in_gdf import warnings from scipy.sparse import dok_matrix, diags, coo_matrix import pandas as pd from tobler.util.util import _check_crs, _nan_check, _inf_check, _check_p...
""" Area Weighted Interpolation """ import numpy as np import geopandas as gpd from ._vectorized_raster_interpolation import _fast_append_profile_in_gdf import warnings from scipy.sparse import dok_matrix, diags, coo_matrix import pandas as pd from tobler.util.util import _check_crs, _nan_check, _inf_check, _check_p...
en
0.720953
Area Weighted Interpolation Construct area allocation and source-target correspondence tables using a spatial indexing approach ... NOTE: this currently relies on Geopandas' spatial index machinery Parameters ---------- source_df : geopandas.GeoDataFrame GeoDataFrame containing input data ...
2.439696
2
cave/com.raytheon.viz.gfe/python/autotest/VTEC_GHG_FFA_TestScript.py
srcarter3/awips2
0
10175
## # This software was developed and / or modified by Raytheon Company, # pursuant to Contract DG133W-05-CQ-1067 with the US Government. # # U.S. EXPORT CONTROLLED TECHNICAL DATA # This software product contains export-restricted data whose # export/transfer/disclosure is restricted by U.S. law. Dissemination # to ...
## # This software was developed and / or modified by Raytheon Company, # pursuant to Contract DG133W-05-CQ-1067 with the US Government. # # U.S. EXPORT CONTROLLED TECHNICAL DATA # This software product contains export-restricted data whose # export/transfer/disclosure is restricted by U.S. law. Dissemination # to ...
en
0.566076
## # This software was developed and / or modified by Raytheon Company, # pursuant to Contract DG133W-05-CQ-1067 with the US Government. # # U.S. EXPORT CONTROLLED TECHNICAL DATA # This software product contains export-restricted data whose # export/transfer/disclosure is restricted by U.S. law. Dissemination # to non-...
0.807086
1
main.py
hasanzadeh99/mapna_test_2021
0
10176
import time old_input_value = False flag_falling_edge = None start = None flag_output_mask = False DELAY_CONST = 10 # delay time from falling edge ... . output = None def response_function(): global old_input_value, flag_falling_edge, start, flag_output_mask, output if flag_falling...
import time old_input_value = False flag_falling_edge = None start = None flag_output_mask = False DELAY_CONST = 10 # delay time from falling edge ... . output = None def response_function(): global old_input_value, flag_falling_edge, start, flag_output_mask, output if flag_falling...
en
0.504065
# delay time from falling edge ... .
3.404546
3
ansiblemetrics/playbook/num_deprecated_modules.py
radon-h2020/AnsibleMetrics
1
10177
<filename>ansiblemetrics/playbook/num_deprecated_modules.py from ansiblemetrics.ansible_modules import DEPRECATED_MODULES_LIST from ansiblemetrics.ansible_metric import AnsibleMetric class NumDeprecatedModules(AnsibleMetric): """ This class measures the number of times tasks use deprecated modules.""" def co...
<filename>ansiblemetrics/playbook/num_deprecated_modules.py from ansiblemetrics.ansible_modules import DEPRECATED_MODULES_LIST from ansiblemetrics.ansible_metric import AnsibleMetric class NumDeprecatedModules(AnsibleMetric): """ This class measures the number of times tasks use deprecated modules.""" def co...
en
0.453836
This class measures the number of times tasks use deprecated modules. Return the deprecated modules occurrence. Example ------- .. highlight:: python .. code-block:: python from ansiblemetrics.general.num_deprecated_modules import NumDeprecatedModules playbook ...
2.534623
3
app/api/v1/validators/validators.py
GraceKiarie/iReporter
1
10178
""" This module does validation for data input in incidents """ import re class Validate(): """ methods for validatin incidents input data """ def valid_email(self, email): self.vemail = re.match( r"(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)", email) if not self.vem...
""" This module does validation for data input in incidents """ import re class Validate(): """ methods for validatin incidents input data """ def valid_email(self, email): self.vemail = re.match( r"(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)", email) if not self.vem...
en
0.547579
This module does validation for data input in incidents methods for validatin incidents input data #$%^&+=]{8,}', password) checks if value in data is empty
3.571932
4
bin/find_latest_versions.py
ebreton/ghost-in-a-shell
2
10179
<reponame>ebreton/ghost-in-a-shell #!/usr/bin/python from distutils.version import LooseVersion import argparse import logging import requests import re session = requests.Session() # authorization token TOKEN_URL = "https://auth.docker.io/token?service=registry.docker.io&scope=repository:%s:pull" # find all tags T...
#!/usr/bin/python from distutils.version import LooseVersion import argparse import logging import requests import re session = requests.Session() # authorization token TOKEN_URL = "https://auth.docker.io/token?service=registry.docker.io&scope=repository:%s:pull" # find all tags TAGS_URL = "https://index.docker.io...
en
0.784932
#!/usr/bin/python # authorization token # find all tags # get image digest for target Version checker script This file retreives the latest version of ghost container image from docker hub It can be run with both python 2.7 and 3.6 # set up level of logging # set up logging to console # version needs to be print to ou...
2.415279
2
tests/conftest.py
badarsebard/terraform-pytest
0
10180
from .terraform import TerraformManager import pytest from _pytest.tmpdir import TempPathFactory @pytest.fixture(scope='session') def tfenv(tmp_path_factory: TempPathFactory): env_vars = { } with TerraformManager(path_factory=tmp_path_factory, env_vars=env_vars) as deployment: yield deplo...
from .terraform import TerraformManager import pytest from _pytest.tmpdir import TempPathFactory @pytest.fixture(scope='session') def tfenv(tmp_path_factory: TempPathFactory): env_vars = { } with TerraformManager(path_factory=tmp_path_factory, env_vars=env_vars) as deployment: yield deplo...
none
1
1.708254
2
pelicanconf.py
myrle-krantz/treasurer-site
1
10181
#!/usr/bin/env python # -*- coding: utf-8 -*- # # vim: encoding=utf-8 # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to yo...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # vim: encoding=utf-8 # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to yo...
en
0.830465
#!/usr/bin/env python # -*- coding: utf-8 -*- # # vim: encoding=utf-8 # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to yo...
1.53358
2
TurtleArt/taturtle.py
sugar-activities/4585-activity
0
10182
# -*- coding: utf-8 -*- #Copyright (c) 2010,12 <NAME> #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal #in the Software without restriction, including without limitation the rights #to use, copy, modify, merge, ...
# -*- coding: utf-8 -*- #Copyright (c) 2010,12 <NAME> #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal #in the Software without restriction, including without limitation the rights #to use, copy, modify, merge, ...
en
0.792446
# -*- coding: utf-8 -*- #Copyright (c) 2010,12 <NAME> #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal #in the Software without restriction, including without limitation the rights #to use, copy, modify, merge, p...
2.184829
2
django_backend/group.py
holg/django_backend
0
10183
try: from django.forms.utils import pretty_name except ImportError: from django.forms.forms import pretty_name from django.template import Context from django.template.loader import render_to_string from .compat import context_flatten class Group(list): """ A simplistic representation of backends tha...
try: from django.forms.utils import pretty_name except ImportError: from django.forms.forms import pretty_name from django.template import Context from django.template.loader import render_to_string from .compat import context_flatten class Group(list): """ A simplistic representation of backends tha...
en
0.924972
A simplistic representation of backends that are related and should be displayed as one "group" in the backend (e.g. as one box in the sidebar).
2.072056
2
src/eodc_openeo_bindings/map_comparison_processes.py
eodcgmbh/eodc-openeo-bindings
0
10184
<filename>src/eodc_openeo_bindings/map_comparison_processes.py """ """ from eodc_openeo_bindings.map_utils import map_default def map_lt(process): """ """ param_dict = {'y': 'float'} return map_default(process, 'lt', 'apply', param_dict) def map_lte(process): """ """ param_dict = ...
<filename>src/eodc_openeo_bindings/map_comparison_processes.py """ """ from eodc_openeo_bindings.map_utils import map_default def map_lt(process): """ """ param_dict = {'y': 'float'} return map_default(process, 'lt', 'apply', param_dict) def map_lte(process): """ """ param_dict = ...
en
0.845223
# NOTE: how to map type dynamically to support strings?
2.566149
3
scripts/flow_tests/__init__.py
rombie/contrail-test
5
10185
<reponame>rombie/contrail-test<gh_stars>1-10 """FLOW RELATED SYSTEM TEST CASES."""
"""FLOW RELATED SYSTEM TEST CASES."""
en
0.741739
FLOW RELATED SYSTEM TEST CASES.
0.997169
1
server/main.py
KejiaQiang/Spicy_pot_search
1
10186
#!/usr/bin/python # -*- coding: utf-8 -*- from flask import Flask, request, abort, render_template from datetime import timedelta import pymysql from search import start_search, decorate page_dir = "E:/WEBPAGES_RAW" app = Flask(__name__) app.config['DEBUG'] = True app.config['SEND_FILE_MAX_AGE_DEFAULT'] ...
#!/usr/bin/python # -*- coding: utf-8 -*- from flask import Flask, request, abort, render_template from datetime import timedelta import pymysql from search import start_search, decorate page_dir = "E:/WEBPAGES_RAW" app = Flask(__name__) app.config['DEBUG'] = True app.config['SEND_FILE_MAX_AGE_DEFAULT'] ...
en
0.44423
#!/usr/bin/python # -*- coding: utf-8 -*-
2.331873
2
examples/3d/subduction/viz/plot_dispwarp.py
cehanagan/pylith
93
10187
<filename>examples/3d/subduction/viz/plot_dispwarp.py #!/usr/bin/env pvpython # -*- Python -*- (syntax highlighting) # ---------------------------------------------------------------------- # # <NAME>, U.S. Geological Survey # <NAME>, GNS Science # <NAME>, University at Buffalo # # This code was developed as part of th...
<filename>examples/3d/subduction/viz/plot_dispwarp.py #!/usr/bin/env pvpython # -*- Python -*- (syntax highlighting) # ---------------------------------------------------------------------- # # <NAME>, U.S. Geological Survey # <NAME>, GNS Science # <NAME>, University at Buffalo # # This code was developed as part of th...
en
0.59386
#!/usr/bin/env pvpython # -*- Python -*- (syntax highlighting) # ---------------------------------------------------------------------- # # <NAME>, U.S. Geological Survey # <NAME>, GNS Science # <NAME>, University at Buffalo # # This code was developed as part of the Computational Infrastructure # for Geodynamics (http...
2.264544
2
src/spaceone/inventory/manager/rds_manager.py
jean1042/plugin-aws-cloud-services
4
10188
from spaceone.inventory.libs.manager import AWSManager # todo: __init__에서 한번에 명세 할수 있게 바꾸기 # 지금은 로케이터에서 글로벌에서 값을 가져오는 로직 때문에 별도 파일이 없으면 에러 발생 class RDSConnectorManager(AWSManager): connector_name = 'RDSConnector'
from spaceone.inventory.libs.manager import AWSManager # todo: __init__에서 한번에 명세 할수 있게 바꾸기 # 지금은 로케이터에서 글로벌에서 값을 가져오는 로직 때문에 별도 파일이 없으면 에러 발생 class RDSConnectorManager(AWSManager): connector_name = 'RDSConnector'
ko
1.000069
# todo: __init__에서 한번에 명세 할수 있게 바꾸기 # 지금은 로케이터에서 글로벌에서 값을 가져오는 로직 때문에 별도 파일이 없으면 에러 발생
1.483464
1
script/upload-checksums.py
fireball-x/atom-shell
4
10189
<filename>script/upload-checksums.py<gh_stars>1-10 #!/usr/bin/env python import argparse import hashlib import os import tempfile from lib.config import s3_config from lib.util import download, rm_rf, s3put DIST_URL = 'https://atom.io/download/atom-shell/' def main(): args = parse_args() url = DIST_URL + arg...
<filename>script/upload-checksums.py<gh_stars>1-10 #!/usr/bin/env python import argparse import hashlib import os import tempfile from lib.config import s3_config from lib.util import download, rm_rf, s3put DIST_URL = 'https://atom.io/download/atom-shell/' def main(): args = parse_args() url = DIST_URL + arg...
ru
0.26433
#!/usr/bin/env python
2.620468
3
pythoncode/kmeansimage.py
loganpadon/PokemonOneShot
0
10190
<gh_stars>0 # import the necessary packages from sklearn.cluster import KMeans import skimage import matplotlib.pyplot as plt import argparse import cv2 def mean_image(image,clt): image2=image for x in range(len(image2)): classes=clt.predict(image2[x]) for y in range(len(classes)): image2[x,y]=clt...
# import the necessary packages from sklearn.cluster import KMeans import skimage import matplotlib.pyplot as plt import argparse import cv2 def mean_image(image,clt): image2=image for x in range(len(image2)): classes=clt.predict(image2[x]) for y in range(len(classes)): image2[x,y]=clt.cluster_cen...
en
0.760657
# import the necessary packages # initialize the bar chart representing the relative frequency # of each of the colors # loop over the percentage of each cluster and the color of # each cluster # plot the relative percentage of each cluster # return the bar chart # import the necessary packages # grab the number of dif...
3.111655
3
tests/encode.py
EddieBreeg/C_b64
0
10191
<gh_stars>0 from sys import argv from base64 import b64encode with open("data", 'rb') as fIn: b = fIn.read() print(b64encode(b).decode())
from sys import argv from base64 import b64encode with open("data", 'rb') as fIn: b = fIn.read() print(b64encode(b).decode())
none
1
2.459261
2
src/json_sort/lib.py
cdumay/json-sort
3
10192
#!/usr/bin/env python # -*- coding: utf-8 -*- """ .. codeauthor:: <NAME> <<EMAIL>> """ import logging import sys, os, json from cdumay_rest_client.client import RESTClient from cdumay_rest_client.exceptions import NotFound, HTTPException class NoSuchFile(NotFound): """NoSuchFile""" def oncritical(exc): "...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ .. codeauthor:: <NAME> <<EMAIL>> """ import logging import sys, os, json from cdumay_rest_client.client import RESTClient from cdumay_rest_client.exceptions import NotFound, HTTPException class NoSuchFile(NotFound): """NoSuchFile""" def oncritical(exc): "...
en
0.533282
#!/usr/bin/env python # -*- coding: utf-8 -*- .. codeauthor:: <NAME> <<EMAIL>> NoSuchFile description of oncritical description of file_exists description of file_write description of from_local description of fromurl
2.410436
2
test/test_create_dataset.py
gregstarr/ttools
0
10193
import numpy as np import pytest import apexpy import tempfile import os import h5py from ttools import create_dataset, config, io, utils map_periods = [np.timedelta64(10, 'm'), np.timedelta64(30, 'm'), np.timedelta64(1, 'h'), np.timedelta64(2, 'h')] @pytest.fixture def times(): yield np.datetime64('2010-01-01T...
import numpy as np import pytest import apexpy import tempfile import os import h5py from ttools import create_dataset, config, io, utils map_periods = [np.timedelta64(10, 'm'), np.timedelta64(30, 'm'), np.timedelta64(1, 'h'), np.timedelta64(2, 'h')] @pytest.fixture def times(): yield np.datetime64('2010-01-01T...
en
0.94663
not that good of a test: wait for bugs and add asserts
1.863567
2
docs_src/options/callback/tutorial001.py
madkinsz/typer
7,615
10194
import typer def name_callback(value: str): if value != "Camila": raise typer.BadParameter("Only Camila is allowed") return value def main(name: str = typer.Option(..., callback=name_callback)): typer.echo(f"Hello {name}") if __name__ == "__main__": typer.run(main)
import typer def name_callback(value: str): if value != "Camila": raise typer.BadParameter("Only Camila is allowed") return value def main(name: str = typer.Option(..., callback=name_callback)): typer.echo(f"Hello {name}") if __name__ == "__main__": typer.run(main)
none
1
2.794564
3
qft-client-py2.py
bocajspear1/qft
0
10195
<reponame>bocajspear1/qft<gh_stars>0 import socket import threading from time import sleep from threading import Thread import json import sys def display_test(address, port,text_result, test): if (text_result == "QFT_SUCCESS" and test == True) or (text_result != "QFT_SUCCESS" and test == False): ...
import socket import threading from time import sleep from threading import Thread import json import sys def display_test(address, port,text_result, test): if (text_result == "QFT_SUCCESS" and test == True) or (text_result != "QFT_SUCCESS" and test == False): # Test is correct ...
en
0.865445
# Test is correct #print(e) # receive data from client (data, addr)
2.979587
3
mdemanipulation/src/mdeoperation.py
modelia/ai-for-model-manipulation
0
10196
<gh_stars>0 #!/usr/bin/env python2 import math import os import random import sys import time import logging import argparse import numpy as np from six.moves import xrange import json import torch import torch.nn as nn import torch.optim as optim from torch import cuda from torch.autograd import Variable from torch...
#!/usr/bin/env python2 import math import os import random import sys import time import logging import argparse import numpy as np from six.moves import xrange import json import torch import torch.nn as nn import torch.optim as optim from torch import cuda from torch.autograd import Variable from torch.nn.utils im...
en
0.197644
#!/usr/bin/env python2 # print("Evaluation time: %s seconds" % (datetime.datetime.now() - start_evaluation_datetime)) # print((datetime.datetime.now() - start_evaluation_datetime)) # print("--Current source / Current target / Current output--") # print(source_vocab) # build_from_scratch = True; # pretrained_model...
2.111134
2
barbican/common/resources.py
stanzikratel/barbican-2
0
10197
<gh_stars>0 # Copyright (c) 2013-2014 Rackspace, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
# Copyright (c) 2013-2014 Rackspace, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
en
0.733914
# Copyright (c) 2013-2014 Rackspace, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
1.924893
2
7/prime.py
redfast00/euler
0
10198
from math import sqrt def stream_primes(num): primes = [] candidate = 2 for i in range(num): prime = next_prime(primes, candidate) primes.append(prime) candidate = prime + 1 yield prime def next_prime(primes, candidate): while True: for prime in primes: ...
from math import sqrt def stream_primes(num): primes = [] candidate = 2 for i in range(num): prime = next_prime(primes, candidate) primes.append(prime) candidate = prime + 1 yield prime def next_prime(primes, candidate): while True: for prime in primes: ...
none
1
3.69698
4
app/utils.py
HealYouDown/flo-league
0
10199
<gh_stars>0 import datetime from app.models import Log from flask_login import current_user from app.extensions import db # https://stackoverflow.com/questions/6558535/find-the-date-for-the-first-monday-after-a-given-date def next_weekday( d: datetime.datetime = datetime.datetime.utcnow(), weekday: int = 0, )...
import datetime from app.models import Log from flask_login import current_user from app.extensions import db # https://stackoverflow.com/questions/6558535/find-the-date-for-the-first-monday-after-a-given-date def next_weekday( d: datetime.datetime = datetime.datetime.utcnow(), weekday: int = 0, ) -> datetime...
en
0.72963
# https://stackoverflow.com/questions/6558535/find-the-date-for-the-first-monday-after-a-given-date # Target day already happened this week # Flatten the current time to just the date
2.465444
2