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
packaging/pack1/andrew_mod1.py
AndreiHondrari/python_exploration
3
11400
<reponame>AndreiHondrari/python_exploration<gh_stars>1-10 def something() -> None: print("Andrew says: `something`.")
def something() -> None: print("Andrew says: `something`.")
none
1
1.639769
2
app/api/v2/views/blacklist.py
MaggieChege/STORE-MANAGER-API-V2
0
11401
blacklist=set() def get_blacklist(): return blacklist def add_to_blacklist(jti): return blacklist.add(jti)
blacklist=set() def get_blacklist(): return blacklist def add_to_blacklist(jti): return blacklist.add(jti)
none
1
1.789515
2
apps/tasks/api/views.py
dayvidemerson/django-rest-example
0
11402
<gh_stars>0 from rest_framework import viewsets from rest_framework import generics from ..models import Task from .serializers import TaskSerializer class TaskViewSet(viewsets.ModelViewSet): serializer_class = TaskSerializer queryset = Task.objects.all()
from rest_framework import viewsets from rest_framework import generics from ..models import Task from .serializers import TaskSerializer class TaskViewSet(viewsets.ModelViewSet): serializer_class = TaskSerializer queryset = Task.objects.all()
none
1
1.75979
2
jarvis/__init__.py
jduncan8142/JARVIS
0
11403
__version__ = "0.0.3" __author__ = "<NAME>" __support__ = "<EMAIL>"
__version__ = "0.0.3" __author__ = "<NAME>" __support__ = "<EMAIL>"
none
1
1.033296
1
src/figcli/test/cli/action.py
figtools/figgy-cli
36
11404
from typing import Union, List import pexpect from figcli.utils.utils import Utils import sys class FiggyAction: """ Actions prevent cyclic dependencies, and are designed for leveraging FiggyCli for cleanup steps when running inside of tests. """ def __init__(self, command, extra_args=""): ...
from typing import Union, List import pexpect from figcli.utils.utils import Utils import sys class FiggyAction: """ Actions prevent cyclic dependencies, and are designed for leveraging FiggyCli for cleanup steps when running inside of tests. """ def __init__(self, command, extra_args=""): ...
en
0.92005
Actions prevent cyclic dependencies, and are designed for leveraging FiggyCli for cleanup steps when running inside of tests.
2.2774
2
test/python/test_elementwise_ops.py
avijit-chakroborty/ngraph-bridge
142
11405
<reponame>avijit-chakroborty/ngraph-bridge # ============================================================================== # Copyright 2018-2020 Intel Corporation # # 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 ...
# ============================================================================== # Copyright 2018-2020 Intel Corporation # # 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://ww...
en
0.75806
# ============================================================================== # Copyright 2018-2020 Intel Corporation # # 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://ww...
1.886134
2
qc/slips.py
mfkiwl/UREGA-qc
0
11406
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: <NAME>. @mail: <EMAIL> """ # from qc.__version__ import __version__ import georinex as gr import numpy as np from matplotlib.pyplot import figure, show import matplotlib.pyplot as plt obs = gr.load( 'tests/test_data/Rinex3/KLSQ00GRL_R_20213070000_01D_1...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: <NAME>. @mail: <EMAIL> """ # from qc.__version__ import __version__ import georinex as gr import numpy as np from matplotlib.pyplot import figure, show import matplotlib.pyplot as plt obs = gr.load( 'tests/test_data/Rinex3/KLSQ00GRL_R_20213070000_01D_1...
en
0.551925
#!/usr/bin/env python3 # -*- coding: utf-8 -*- @author: <NAME>. @mail: <EMAIL> # from qc.__version__ import __version__ # tlim=['2021-11-03T12:00', '2021-11-03T12:30']) # tlim=['2021-11-03T15:00', '2021-11-03T18:00']) # hdr = gr.rinexheader( # 'tests/test_data/Rinex3/KLSQ00GRL_R_20213070000_01D_15S_MO.rnx') # rnx_v...
2.0353
2
tests/test_utils.py
jga/goldfinchsong
0
11407
from collections import OrderedDict from datetime import datetime, timezone import unittest from os.path import join from tinydb import TinyDB, storages from goldfinchsong import utils IMAGE_NAMES = ['goldfinch1.jpg', 'goldfinch2.jpg', 'goldfinch3.jpg', 'goldfinch4.jpg', 'goldfinch5.jpg'] TEST_TEXT1 = ...
from collections import OrderedDict from datetime import datetime, timezone import unittest from os.path import join from tinydb import TinyDB, storages from goldfinchsong import utils IMAGE_NAMES = ['goldfinch1.jpg', 'goldfinch2.jpg', 'goldfinch3.jpg', 'goldfinch4.jpg', 'goldfinch5.jpg'] TEST_TEXT1 = ...
en
0.752146
# let's load a list of tweets into the db # exhausts all conversions before reaching limit
2.691379
3
lingvo/tasks/image/input_generator.py
allenwang28/lingvo
2,611
11408
# Lint as: python3 # Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # 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 ...
# Lint as: python3 # Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # 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 ...
en
0.762163
# Lint as: python3 # Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # 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 ...
2.345141
2
src/solutions/part1/q389_find_diff.py
hychrisli/PyAlgorithms
0
11409
from src.base.solution import Solution from src.tests.part1.q389_test_find_diff import FindDiffTestCases class FindDiff(Solution): def verify_output(self, test_output, output): return test_output[0] == output[0] def run_test(self, input): return self.findTheDifference(input[0], input[1]) ...
from src.base.solution import Solution from src.tests.part1.q389_test_find_diff import FindDiffTestCases class FindDiff(Solution): def verify_output(self, test_output, output): return test_output[0] == output[0] def run_test(self, input): return self.findTheDifference(input[0], input[1]) ...
en
0.276753
:type s: str :type t: str :rtype: str
2.859361
3
mydict.py
zengboming/python
0
11410
<reponame>zengboming/python #unit #mydict.py class Dict(dict): def __init__(self,**kw): super(Dict,self).__init__(**kw) def __getattr__(self,key): try: return self[key] except KeyError: raise AttributeError(r"'Dict' object han no attribute'%s'" %key) def __setattr__(self,key,value): self[key]=value ...
#unit #mydict.py class Dict(dict): def __init__(self,**kw): super(Dict,self).__init__(**kw) def __getattr__(self,key): try: return self[key] except KeyError: raise AttributeError(r"'Dict' object han no attribute'%s'" %key) def __setattr__(self,key,value): self[key]=value
en
0.138988
#unit #mydict.py
3.408567
3
copy_annotations/conflict.py
abhinav-kumar-thakur/TabularCellTypeClassification
19
11411
import contextlib import os import tempfile import warnings from enum import Enum import mip class IISFinderAlgorithm(Enum): DELETION_FILTER = 1 ADDITIVE_ALGORITHM = 2 class SubRelaxationInfeasible(Exception): pass class NonRelaxableModel(Exception): pass class ConflictFinder: """This class...
import contextlib import os import tempfile import warnings from enum import Enum import mip class IISFinderAlgorithm(Enum): DELETION_FILTER = 1 ADDITIVE_ALGORITHM = 2 class SubRelaxationInfeasible(Exception): pass class NonRelaxableModel(Exception): pass class ConflictFinder: """This class...
en
0.708814
This class groups some IIS (Irreducible Infeasible Set) search algorithms # feasibility # -1 automatic, 0 off, 1 on. main method to find an IIS, this method is just a grouping of the other implementations Args: model (mip.Model): Infeasible model where to find the IIS method (str, opt...
2.530523
3
output/models/nist_data/atomic/integer/schema_instance/nistschema_sv_iv_atomic_integer_pattern_1_xsd/__init__.py
tefra/xsdata-w3c-tests
1
11412
<filename>output/models/nist_data/atomic/integer/schema_instance/nistschema_sv_iv_atomic_integer_pattern_1_xsd/__init__.py from output.models.nist_data.atomic.integer.schema_instance.nistschema_sv_iv_atomic_integer_pattern_1_xsd.nistschema_sv_iv_atomic_integer_pattern_1 import NistschemaSvIvAtomicIntegerPattern1 __all...
<filename>output/models/nist_data/atomic/integer/schema_instance/nistschema_sv_iv_atomic_integer_pattern_1_xsd/__init__.py from output.models.nist_data.atomic.integer.schema_instance.nistschema_sv_iv_atomic_integer_pattern_1_xsd.nistschema_sv_iv_atomic_integer_pattern_1 import NistschemaSvIvAtomicIntegerPattern1 __all...
none
1
1.137887
1
Dietscheduler/lib/menu_converter.py
floromaer/DietScheduler
0
11413
import re import xlsxwriter def parse_menu_to_excel(filename,menu_dict,days_dict,results,goal_dict,food_database,reversed_ingredient_dict,grocery_dict): # making a temporary dict to map dates and columns in excel: temp_dates_dict = {} i=0 for key in days_dict.keys(): temp_dates_dict[day...
import re import xlsxwriter def parse_menu_to_excel(filename,menu_dict,days_dict,results,goal_dict,food_database,reversed_ingredient_dict,grocery_dict): # making a temporary dict to map dates and columns in excel: temp_dates_dict = {} i=0 for key in days_dict.keys(): temp_dates_dict[day...
en
0.792539
# making a temporary dict to map dates and columns in excel: # converting the menu-dict to dates and lunches # putting it into an excel file: # make worksheets # for menu # print the menu to menu-sheet # writing the global grocery-list: # writing the recipe-lists:
3.255243
3
example_problems/tutorial/graph_connectivity/services/esempi/check_one_sol_server.py
romeorizzi/TAlight
3
11414
<gh_stars>1-10 #!/usr/bin/env python3 from sys import stderr, exit from TALinputs import TALinput from multilanguage import Env, Lang, TALcolors from parentheses_lib import recognize # METADATA OF THIS TAL_SERVICE: problem="parentheses" service="check_one_sol_server" args_list = [ ('input_formula',st...
#!/usr/bin/env python3 from sys import stderr, exit from TALinputs import TALinput from multilanguage import Env, Lang, TALcolors from parentheses_lib import recognize # METADATA OF THIS TAL_SERVICE: problem="parentheses" service="check_one_sol_server" args_list = [ ('input_formula',str), ('n',s...
en
0.3551
#!/usr/bin/env python3 # METADATA OF THIS TAL_SERVICE: # START CODING YOUR SERVICE:
2.895372
3
app/validation/translator.py
codingedward/book-a-meal-api
0
11415
<gh_stars>0 """Translates validation error messages for the response""" messages = { 'accepted': 'The :field: must be accepted.', 'after': 'The :field: must be a date after :other:.', 'alpha': 'The :field: may contain only letters.', 'alpha_dash': 'The :field: may only contain letters, numbers, and da...
"""Translates validation error messages for the response""" messages = { 'accepted': 'The :field: must be accepted.', 'after': 'The :field: must be a date after :other:.', 'alpha': 'The :field: may contain only letters.', 'alpha_dash': 'The :field: may only contain letters, numbers, and dashes.', ...
en
0.497097
Translates validation error messages for the response
2.720729
3
chat/main/consumers.py
mlambir/channels_talk_pyconar2016
12
11416
from channels import Group # websocket.connect def ws_add(message): Group("chat").add(message.reply_channel) # websocket.receive def ws_message(message): Group("chat").send({ "text": message.content['text'], }) # websocket.disconnect def ws_disconnect(message): Group("chat").discard(message.r...
from channels import Group # websocket.connect def ws_add(message): Group("chat").add(message.reply_channel) # websocket.receive def ws_message(message): Group("chat").send({ "text": message.content['text'], }) # websocket.disconnect def ws_disconnect(message): Group("chat").discard(message.r...
en
0.604237
# websocket.connect # websocket.receive # websocket.disconnect
2.498742
2
env/enviroment.py
Dorebom/robot_pybullet
0
11417
from copy import deepcopy import numpy as np import pybullet as p import gym from gym import spaces from env.robot import Manipulator from env.work import Work class Env(): def __init__(self, reward, step_max_pos = 0.002, step_max_orn = 0.02, initial_pos_noise = 0.0...
from copy import deepcopy import numpy as np import pybullet as p import gym from gym import spaces from env.robot import Manipulator from env.work import Work class Env(): def __init__(self, reward, step_max_pos = 0.002, step_max_orn = 0.02, initial_pos_noise = 0.0...
ja
0.350417
# Init # Plane # robot # for learning # Load work # Load robot # For 処理の高速化 if np.linalg.norm( np.array(tool_pose) - self.prev_tool_pose ) < 1e-6: else: # Reset env # Load Plane # Reset work # Reset Robot # ここは指令値生成なので,真値が良い observe act_abs_tcp_pose act_rel_tcp_pose act_abs_work_pose ...
2.468735
2
Thread/Threading.py
zxg110/PythonGrammer
0
11418
import _thread import time import threading # # def print_time(threadName,delay): # count = 0; # while count < 5: # time.sleep(delay) # count += 1; # print("%s: %s" % (threadName, time.ctime(time.time()))) # # try: # _thread.start_new(print_time,("Thread-1",2,)) # _thread.start_n...
import _thread import time import threading # # def print_time(threadName,delay): # count = 0; # while count < 5: # time.sleep(delay) # count += 1; # print("%s: %s" % (threadName, time.ctime(time.time()))) # # try: # _thread.start_new(print_time,("Thread-1",2,)) # _thread.start_n...
zh
0.863796
# # def print_time(threadName,delay): # count = 0; # while count < 5: # time.sleep(delay) # count += 1; # print("%s: %s" % (threadName, time.ctime(time.time()))) # # try: # _thread.start_new(print_time,("Thread-1",2,)) # _thread.start_new(print_time("Thread-2",4)) # except: # ...
3.726866
4
server/petsAPI/views.py
StoyanDimStoyanov/ReactDJango
0
11419
<reponame>StoyanDimStoyanov/ReactDJango from django.shortcuts import render from rest_framework import generics # Create your views here. from petsAPI.models import Pets from petsAPI.serializers import PetSerializer def index(req): return render(req, 'index.html') class PetsListApiView(generics.ListCreateAPIVi...
from django.shortcuts import render from rest_framework import generics # Create your views here. from petsAPI.models import Pets from petsAPI.serializers import PetSerializer def index(req): return render(req, 'index.html') class PetsListApiView(generics.ListCreateAPIView): queryset = Pets.objects.all() ...
en
0.968116
# Create your views here.
1.990607
2
cluster_faces.py
sandhyalaxmiK/faces_clustering
0
11420
<filename>cluster_faces.py import face_recognition import sys,os import re,cv2 def sorted_alphanumeric(data): convert = lambda text: int(text) if text.isdigit() else text.lower() alphanum_key = lambda key: [ convert(c) for c in re.split('([0-9]+)', key) ] return sorted(data, key=alphanum_key) input_dir_pa...
<filename>cluster_faces.py import face_recognition import sys,os import re,cv2 def sorted_alphanumeric(data): convert = lambda text: int(text) if text.isdigit() else text.lower() alphanum_key = lambda key: [ convert(c) for c in re.split('([0-9]+)', key) ] return sorted(data, key=alphanum_key) input_dir_pa...
none
1
2.695048
3
src/bbdata/endpoint/output/objects.py
big-building-data/bbdata-python
0
11421
import requests from bbdata.config import output_api_url from bbdata.util import handle_response class Objects: base_path = "/objects" auth = None def __init__(self, auth): self.auth = auth def get_all(self, tags=None, search=None, page=None, per_page=None, writable=False): ...
import requests from bbdata.config import output_api_url from bbdata.util import handle_response class Objects: base_path = "/objects" auth = None def __init__(self, auth): self.auth = auth def get_all(self, tags=None, search=None, page=None, per_page=None, writable=False): ...
en
0.59121
Get the list of accessible objects. GET /objects https://bbdata.daplab.ch/api/#objects_get Create a new object. PUT /objects https://bbdata.daplab.ch/api/#objects_put Get an object. GET /objects/{objectIs} https://bbdata.daplab.ch/api/#objects__objectid__get # return O...
2.773932
3
python/tako/client/__init__.py
vyomkeshj/tako
0
11422
<gh_stars>0 from .exception import TakoException, TaskFailed # noqa from .session import connect # noqa
from .exception import TakoException, TaskFailed # noqa from .session import connect # noqa
uz
0.443564
# noqa # noqa
0.995727
1
helpers/parser.py
yasahi-hpc/AMRNet
0
11423
<gh_stars>0 import argparse def parse(): parser = argparse.ArgumentParser(add_help=True) parser.add_argument('-data_dir', \ action='store', \ nargs='?', \ const=None, \ default='./dataset', \ ...
import argparse def parse(): parser = argparse.ArgumentParser(add_help=True) parser.add_argument('-data_dir', \ action='store', \ nargs='?', \ const=None, \ default='./dataset', \ type=str, \...
en
0.475016
# Used for inference
2.358121
2
api/patients/urls.py
Wellheor1/l2
10
11424
<filename>api/patients/urls.py from django.urls import path from . import views urlpatterns = [ path('search-card', views.patients_search_card), path('search-individual', views.patients_search_individual), path('search-l2-card', views.patients_search_l2_card), path('create-l2-individual-from-card', vie...
<filename>api/patients/urls.py from django.urls import path from . import views urlpatterns = [ path('search-card', views.patients_search_card), path('search-individual', views.patients_search_individual), path('search-l2-card', views.patients_search_l2_card), path('create-l2-individual-from-card', vie...
none
1
1.744777
2
resolwe_bio/kb/migrations/0002_alter_field_max_length.py
JureZmrzlikar/resolwe-bio
0
11425
# -*- coding: utf-8 -*- # Generated by Django 1.9.11 on 2016-11-15 07:06 from __future__ import unicode_literals import django.contrib.postgres.fields from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('resolwe_bio_kb', '0001_initial'), ] operation...
# -*- coding: utf-8 -*- # Generated by Django 1.9.11 on 2016-11-15 07:06 from __future__ import unicode_literals import django.contrib.postgres.fields from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('resolwe_bio_kb', '0001_initial'), ] operation...
en
0.800807
# -*- coding: utf-8 -*- # Generated by Django 1.9.11 on 2016-11-15 07:06
1.729741
2
setup.py
conan-hdk/xlwings
0
11426
<reponame>conan-hdk/xlwings<gh_stars>0 import os import sys import re import glob from setuptools import setup, find_packages # long_description: Take from README file with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f: readme = f.read() # Version Number with open(os.path.join(os.path.dirname(_...
import os import sys import re import glob from setuptools import setup, find_packages # long_description: Take from README file with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f: readme = f.read() # Version Number with open(os.path.join(os.path.dirname(__file__), 'xlwings', '__init__.py')) as...
en
0.639345
# long_description: Take from README file # Version Number # Dependencies # This places dlls next to python.exe for standard setup and in the parent folder for virtualenv
1.950351
2
secedgar/tests/test_cli.py
abbadata/sec-edgar
0
11427
import pytest from click.testing import CliRunner from secedgar.cli import daily, filing from secedgar.utils.exceptions import FilingTypeError def run_cli_command(cli, user_input, directory, catch_exceptions=False): runner = CliRunner() user_input = user_input + " --directory {}".format(directory) return ...
import pytest from click.testing import CliRunner from secedgar.cli import daily, filing from secedgar.utils.exceptions import FilingTypeError def run_cli_command(cli, user_input, directory, catch_exceptions=False): runner = CliRunner() user_input = user_input + " --directory {}".format(directory) return ...
en
0.8348
# SystemExit does not raise exception by runner # missing filing type # unrecognized filing type # count is not int # no filings available if 0 picked
2.321885
2
hydro.py
garethcmurphy/hydrosolve
0
11428
import os import numpy as np import matplotlib.pyplot as plt from matplotlib import gridspec nstep=200 nx=400 nv=3 u=np.zeros((nx,nv)) prim=np.zeros((nx,nv)) gam=5./3. dx=1./nx dt=1e-3 time=0 x=np.linspace(0,1,num=nx) def ptou(pri): u=np.zeros((nx,nv)) rho=pri[:,0] v=pri[:,1] prs=pri[:,2] mom=rho*v ...
import os import numpy as np import matplotlib.pyplot as plt from matplotlib import gridspec nstep=200 nx=400 nv=3 u=np.zeros((nx,nv)) prim=np.zeros((nx,nv)) gam=5./3. dx=1./nx dt=1e-3 time=0 x=np.linspace(0,1,num=nx) def ptou(pri): u=np.zeros((nx,nv)) rho=pri[:,0] v=pri[:,1] prs=pri[:,2] mom=rho*v ...
none
1
2.474054
2
tests/test_pluralize.py
weixu365/pluralizer-py
4
11429
import unittest from pluralizer import Pluralizer import re # Standard singular/plural matches. # # @type {Array} BASIC_TESTS = [ # Uncountables. ['firmware', 'firmware'], ['fish', 'fish'], ['media', 'media'], ['moose', 'moose'], ['police', 'police'], ['sheep', 'sheep'], ['series', 's...
import unittest from pluralizer import Pluralizer import re # Standard singular/plural matches. # # @type {Array} BASIC_TESTS = [ # Uncountables. ['firmware', 'firmware'], ['fish', 'fish'], ['media', 'media'], ['moose', 'moose'], ['police', 'police'], ['sheep', 'sheep'], ['series', 's...
en
0.759832
# Standard singular/plural matches. # # @type {Array} # Uncountables. # Latin. # Pluralization. # Proper spelling is "dwarfs". # Maybe "indexes". # Could also be plural of "ax". # Prototype inheritance. # Non-standard case. # # Odd plural to singular tests. # # @type {Array} # # # Odd singular to plural tests. # # @typ...
2.879945
3
promgen/util.py
sundy-li/promgen
0
11430
# Copyright (c) 2017 LINE Corporation # These sources are released under the terms of the MIT license: see LICENSE import requests.sessions from django.db.models import F from promgen.version import __version__ from django.conf import settings # Wrappers around request api to ensure we always attach our user agent #...
# Copyright (c) 2017 LINE Corporation # These sources are released under the terms of the MIT license: see LICENSE import requests.sessions from django.db.models import F from promgen.version import __version__ from django.conf import settings # Wrappers around request api to ensure we always attach our user agent #...
en
0.795135
# Copyright (c) 2017 LINE Corporation # These sources are released under the terms of the MIT license: see LICENSE # Wrappers around request api to ensure we always attach our user agent # https://github.com/requests/requests/blob/master/requests/api.py Settings helper based on saltstack's query Allows a simple wa...
2.20738
2
integration_tests/test_suites/k8s-integration-test-suite/test_utils.py
ericct/dagster
0
11431
import time import kubernetes import pytest from dagster_k8s.client import DagsterK8sError, WaitForPodState from dagster_k8s.utils import retrieve_pod_logs, wait_for_job_success, wait_for_pod from dagster_k8s_test_infra.helm import get_helm_test_namespace def construct_pod_spec(name, cmd): return kubernetes.clie...
import time import kubernetes import pytest from dagster_k8s.client import DagsterK8sError, WaitForPodState from dagster_k8s.utils import retrieve_pod_logs, wait_for_job_success, wait_for_pod from dagster_k8s_test_infra.helm import get_helm_test_namespace def construct_pod_spec(name, cmd): return kubernetes.clie...
en
0.716
# pylint: disable=unused-argument # Without this sleep, we get the following error on kind: # HTTP response body: # {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"No API # token found for service account \"default\", retry after the token is automatically # created and added to the servi...
1.758929
2
radioepg/migrations/0001_initial.py
mervij/radiodns
0
11432
# Generated by Django 3.1.6 on 2021-02-15 08:52 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Service', fields=[ ...
# Generated by Django 3.1.6 on 2021-02-15 08:52 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Service', fields=[ ...
en
0.78368
# Generated by Django 3.1.6 on 2021-02-15 08:52
1.70256
2
uitester/ui/case_manager/tag_names_line_edit.py
IfengAutomation/uitester
4
11433
<filename>uitester/ui/case_manager/tag_names_line_edit.py from PyQt5.QtCore import Qt, QStringListModel from PyQt5.QtWidgets import QLineEdit, QCompleter class TagNamesLineEdit(QLineEdit): def __init__(self, parent=None): super(QLineEdit, self).__init__(parent) self.cmp = None self.is_comp...
<filename>uitester/ui/case_manager/tag_names_line_edit.py from PyQt5.QtCore import Qt, QStringListModel from PyQt5.QtWidgets import QLineEdit, QCompleter class TagNamesLineEdit(QLineEdit): def __init__(self, parent=None): super(QLineEdit, self).__init__(parent) self.cmp = None self.is_comp...
none
1
2.067534
2
utils/__init__.py
millermuttu/torch_soft
0
11434
# # importing all the modules at once # from .config import * # from .normalization import * # from .others import * # from .img_reg import * # from .transformation import * # from .visualization import * # importing the modules in a selective way import utils.config import utils.normalization import utils.misc import...
# # importing all the modules at once # from .config import * # from .normalization import * # from .others import * # from .img_reg import * # from .transformation import * # from .visualization import * # importing the modules in a selective way import utils.config import utils.normalization import utils.misc import...
en
0.504407
# # importing all the modules at once # from .config import * # from .normalization import * # from .others import * # from .img_reg import * # from .transformation import * # from .visualization import * # importing the modules in a selective way
1.068018
1
tasks.py
epu-ntua/QualiChain-mediator
2
11435
from celery import Celery from clients.dobie_client import send_data_to_dobie app = Celery('qualichain_mediator') app.config_from_object('settings', namespace='CELERY_') @app.task() def consume_messages_async(message): """ This task is used to received job posting text and feed DOBIE component """ e...
from celery import Celery from clients.dobie_client import send_data_to_dobie app = Celery('qualichain_mediator') app.config_from_object('settings', namespace='CELERY_') @app.task() def consume_messages_async(message): """ This task is used to received job posting text and feed DOBIE component """ e...
en
0.984946
This task is used to received job posting text and feed DOBIE component
2.329493
2
ingest/ambit_geo.py
brianhouse/okavango
2
11436
import json, math from ingest import ingest_json_body from housepy import config, log, strings, util def parse(request): log.info("ambit_geo.parse") sample = ingest_json_body(request) if sample is None: return sample, "Could not parse" data = {} for key, value in sample.items(): if...
import json, math from ingest import ingest_json_body from housepy import config, log, strings, util def parse(request): log.info("ambit_geo.parse") sample = ingest_json_body(request) if sample is None: return sample, "Could not parse" data = {} for key, value in sample.items(): if...
en
0.971921
# these are marked UTC in the data
2.771879
3
gandyndns.py
nim65s/scripts
1
11437
#!/usr/bin/env python '''update gandi DNS domain entry, with LiveDNS v5 Cf. https://doc.livedns.gandi.net/#work-with-domains ''' import argparse import ipaddress import json import os from subprocess import check_output import requests parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('-v', '...
#!/usr/bin/env python '''update gandi DNS domain entry, with LiveDNS v5 Cf. https://doc.livedns.gandi.net/#work-with-domains ''' import argparse import ipaddress import json import os from subprocess import check_output import requests parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('-v', '...
en
0.591054
#!/usr/bin/env python update gandi DNS domain entry, with LiveDNS v5 Cf. https://doc.livedns.gandi.net/#work-with-domains
2.168651
2
leetcode.com/python/314_Binary_Tree_Vertical_Order_Traversal.py
mamane19/coding-interview-gym
713
11438
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right from collections import deque from collections import defaultdict class Solution(object): def verticalOrder(self, ...
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right from collections import deque from collections import defaultdict class Solution(object): def verticalOrder(self, ...
en
0.612182
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right :type root: TreeNode :rtype: List[List[int]] # My solution during mock, getting TLE, don't know why :type root: ...
3.590218
4
src/sentry/models/pluginhealth.py
ayesha-omarali/sentry
0
11439
<reponame>ayesha-omarali/sentry from __future__ import absolute_import from sentry.db.models import ( ArrayField, BoundedPositiveIntegerField, Model, FlexibleForeignKey, sane_repr ) from django.db import models from jsonfield import JSONField from django.utils import timezone from sentry.constants import ObjectSta...
from __future__ import absolute_import from sentry.db.models import ( ArrayField, BoundedPositiveIntegerField, Model, FlexibleForeignKey, sane_repr ) from django.db import models from jsonfield import JSONField from django.utils import timezone from sentry.constants import ObjectStatus from django.utils.translatio...
none
1
1.926276
2
src/masonite/oauth/drivers/FacebookDriver.py
girardinsamuel/masonite-socialite
1
11440
from .BaseDriver import BaseDriver from ..OAuthUser import OAuthUser class FacebookDriver(BaseDriver): def get_default_scopes(self): return ["email"] def get_auth_url(self): return "https://www.facebook.com/dialog/oauth" def get_token_url(self): return "https://graph.facebook.com...
from .BaseDriver import BaseDriver from ..OAuthUser import OAuthUser class FacebookDriver(BaseDriver): def get_default_scopes(self): return ["email"] def get_auth_url(self): return "https://www.facebook.com/dialog/oauth" def get_token_url(self): return "https://graph.facebook.com...
none
1
2.586369
3
python/convert_to_readwise.py
t27/highlights-convert
0
11441
<filename>python/convert_to_readwise.py import pandas as pd import json import glob columns = ["Highlight","Title","Author","URL","Note","Location"] # for sample of the input json look at any json in the root of the `results` folder def convert_to_readwise_df(json_files): """Convert the internal json format to a ...
<filename>python/convert_to_readwise.py import pandas as pd import json import glob columns = ["Highlight","Title","Author","URL","Note","Location"] # for sample of the input json look at any json in the root of the `results` folder def convert_to_readwise_df(json_files): """Convert the internal json format to a ...
en
0.702731
# for sample of the input json look at any json in the root of the `results` folder Convert the internal json format to a readwise compatible dataframe Args: json_files (List[str]): list of json files Returns: pd.DataFrame: dataframe with columns as required by readwise
3.498196
3
ms_deisotope/qc/__init__.py
mstim/ms_deisotope
18
11442
"""A collection of methods for determining whether a given spectrum is of high quality (likely to produce a high quality interpretation) """ from .heuristic import xrea from .isolation import CoIsolation, PrecursorPurityEstimator __all__ = [ "xrea", "CoIsolation", "PrecursorPurityEstimator" ]
"""A collection of methods for determining whether a given spectrum is of high quality (likely to produce a high quality interpretation) """ from .heuristic import xrea from .isolation import CoIsolation, PrecursorPurityEstimator __all__ = [ "xrea", "CoIsolation", "PrecursorPurityEstimator" ]
en
0.79793
A collection of methods for determining whether a given spectrum is of high quality (likely to produce a high quality interpretation)
1.602163
2
rpi_animations/message.py
Anski-D/rpi_animations_old
0
11443
<filename>rpi_animations/message.py from .item import Item class Message(Item): """ Message feature object in the rpi_animations package. """ def __init__(self, group, screen_animator) -> None: """ Initialise Message object with sprite group and screen object. Run initial setup method...
<filename>rpi_animations/message.py from .item import Item class Message(Item): """ Message feature object in the rpi_animations package. """ def __init__(self, group, screen_animator) -> None: """ Initialise Message object with sprite group and screen object. Run initial setup method...
en
0.673673
Message feature object in the rpi_animations package. Initialise Message object with sprite group and screen object. Run initial setup methods. Args: group (Group): Pygame sprite group to which the object will be added. screen_animator (ScreenAnimator): Main package object controlling t...
3.04083
3
styrobot/cogs/help.py
ThatRedKite/styrobot
1
11444
<reponame>ThatRedKite/styrobot<gh_stars>1-10 import discord from discord.ext import commands from styrobot.util.contrib import info import random class BetterHelpCommand(commands.HelpCommand): async def send_embed(self, embed): embed.colour = discord.Colour.random() await self.get_destination().se...
import discord from discord.ext import commands from styrobot.util.contrib import info import random class BetterHelpCommand(commands.HelpCommand): async def send_embed(self, embed): embed.colour = discord.Colour.random() await self.get_destination().send(embed=embed) def blank_line(self, emb...
en
0.774513
# slightly copied from discord.py
2.528745
3
misc/Queue_hello.py
benhunter/py-stuff
3
11445
<reponame>benhunter/py-stuff<gh_stars>1-10 # Testing with threading and queue modules for Thread-based parallelism import threading, queue, time # The worker thread gets jobs off the queue. When the queue is empty, it # assumes there will be no more work and exits. # (Realistically workers will run until terminated...
# Testing with threading and queue modules for Thread-based parallelism import threading, queue, time # The worker thread gets jobs off the queue. When the queue is empty, it # assumes there will be no more work and exits. # (Realistically workers will run until terminated.) def worker(): print('Running worker'...
en
0.826063
# Testing with threading and queue modules for Thread-based parallelism # The worker thread gets jobs off the queue. When the queue is empty, it # assumes there will be no more work and exits. # (Realistically workers will run until terminated.) # False to terminate Thread when no work is available # do the work # Cre...
3.972361
4
tests/conftest.py
Beanxx/alonememo
0
11446
<reponame>Beanxx/alonememo import pytest from pymongo import MongoClient import app as flask_app test_database_name = 'spartatest' client = MongoClient('localhost', 27017) db = client.get_database(test_database_name) @pytest.fixture def app(): test_app = flask_app.create_app(test_database_name) # 제네레이터 문법...
import pytest from pymongo import MongoClient import app as flask_app test_database_name = 'spartatest' client = MongoClient('localhost', 27017) db = client.get_database(test_database_name) @pytest.fixture def app(): test_app = flask_app.create_app(test_database_name) # 제네레이터 문법(yield 구문까지만 실행하고 대기, #...
ko
1.000054
# 제네레이터 문법(yield 구문까지만 실행하고 대기, # 이후 다시 호출할 때 yield 구문 다음이 진행됨) # app이 종료되는 것이 아니라 stop됨. # 여기서부터는 모든 테스트가 완료되고 나서 시행됨
2.237376
2
threader/__init__.py
mwoolweaver/threader
34
11447
"""Tools to quickly create twitter threads.""" from .thread import Threader __version__ = "0.1.1"
"""Tools to quickly create twitter threads.""" from .thread import Threader __version__ = "0.1.1"
en
0.859784
Tools to quickly create twitter threads.
1.293801
1
src/utility/count_pages.py
WikiCommunityHealth/wikimedia-revert
0
11448
<reponame>WikiCommunityHealth/wikimedia-revert<gh_stars>0 # count numbers of pages from the Mediawiki history dumps import bz2 import subprocess import os from datetime import datetime inizio = datetime.now() dataset_folder = '/home/gandelli/dev/data/it/' totali = set() revisioni = set() revert = set() ns0 = set() ...
# count numbers of pages from the Mediawiki history dumps import bz2 import subprocess import os from datetime import datetime inizio = datetime.now() dataset_folder = '/home/gandelli/dev/data/it/' totali = set() revisioni = set() revert = set() ns0 = set() for year in range(2001, 2021): dump_in = bz2.open(da...
en
0.529999
# count numbers of pages from the Mediawiki history dumps
2.890777
3
livescore/LivescoreCommon.py
TechplexEngineer/frc-livescore
0
11449
import colorsys import cv2 from PIL import Image import pkg_resources from .LivescoreBase import LivescoreBase from .details import Alliance, OngoingMatchDetails class LivescoreCommon(LivescoreBase): def __init__(self, game_year, **kwargs): super(LivescoreCommon, self).__init__(game_year, **kwargs) ...
import colorsys import cv2 from PIL import Image import pkg_resources from .LivescoreBase import LivescoreBase from .details import Alliance, OngoingMatchDetails class LivescoreCommon(LivescoreBase): def __init__(self, game_year, **kwargs): super(LivescoreCommon, self).__init__(game_year, **kwargs) ...
en
0.682766
# Check for match under review # Find time remaining # draw a green box for time # Determine mode: 'pre_match', 'auto', 'teleop', or 'post_match' # Both saturated # First saturated # End of auton # Sample point to determine red/blue side # More blue than red # Left score limits # Right score limits
2.089305
2
challenges/challenge.py
Tech-With-Tim/models
2
11450
<filename>challenges/challenge.py<gh_stars>1-10 from postDB import Model, Column, types from datetime import datetime import utils class Challenge(Model): """ Challenge class to store the challenge details Database Attributes: Attributes stored in the `challenges` table. :param int id: ...
<filename>challenges/challenge.py<gh_stars>1-10 from postDB import Model, Column, types from datetime import datetime import utils class Challenge(Model): """ Challenge class to store the challenge details Database Attributes: Attributes stored in the `challenges` table. :param int id: ...
en
0.725942
Challenge class to store the challenge details Database Attributes: Attributes stored in the `challenges` table. :param int id: The challenge Snowflake ID. :param str title: The challenge title. :param int author_id: ...
3.04324
3
settings.py
embrace-inpe/cycle-slip-correction
6
11451
""" Commom settings to all applications """ A = 40.3 TECU = 1.0e16 C = 299792458 F1 = 1.57542e9 F2 = 1.22760e9 factor_1 = (F1 - F2) / (F1 + F2) / C factor_2 = (F1 * F2) / (F2 - F1) / C DIFF_TEC_MAX = 0.05 LIMIT_STD = 7.5 plot_it = True REQUIRED_VERSION = 3.01 CONSTELLATIONS = ['G', 'R'] COLUMNS_IN_RINEX = {'3.03': ...
""" Commom settings to all applications """ A = 40.3 TECU = 1.0e16 C = 299792458 F1 = 1.57542e9 F2 = 1.22760e9 factor_1 = (F1 - F2) / (F1 + F2) / C factor_2 = (F1 * F2) / (F2 - F1) / C DIFF_TEC_MAX = 0.05 LIMIT_STD = 7.5 plot_it = True REQUIRED_VERSION = 3.01 CONSTELLATIONS = ['G', 'R'] COLUMNS_IN_RINEX = {'3.03': ...
en
0.780882
Commom settings to all applications
1.886548
2
io_almacen/channel/__init__.py
xyla-io/io_almacen
0
11452
<reponame>xyla-io/io_almacen<gh_stars>0 from .channel_io import Channel, channel_entity_url
from .channel_io import Channel, channel_entity_url
none
1
1.071899
1
tests/api/test_libcoap_api.py
ggravlingen/ikeatradfri
726
11453
"""Test API utilities.""" import json from pytradfri.api.libcoap_api import APIFactory from pytradfri.gateway import Gateway def test_constructor_timeout_passed_to_subprocess(monkeypatch): """Test that original timeout is passed to subprocess.""" capture = {} def capture_args(*args, **kwargs): c...
"""Test API utilities.""" import json from pytradfri.api.libcoap_api import APIFactory from pytradfri.gateway import Gateway def test_constructor_timeout_passed_to_subprocess(monkeypatch): """Test that original timeout is passed to subprocess.""" capture = {} def capture_args(*args, **kwargs): c...
en
0.88828
Test API utilities. Test that original timeout is passed to subprocess. Test that custom timeout is passed to subprocess.
2.462988
2
scrape_tvz.py
awordforthat/rhymes
0
11454
# scrapes Townes van Zandt lyrics # sample code so I don't have to remember all of this stuff # the next time I want to source some verses from bs4 import BeautifulSoup as soup import requests import string punctuation_trans_table = str.maketrans("", "", string.punctuation) def strip_punctuation(s): return s.tr...
# scrapes Townes van Zandt lyrics # sample code so I don't have to remember all of this stuff # the next time I want to source some verses from bs4 import BeautifulSoup as soup import requests import string punctuation_trans_table = str.maketrans("", "", string.punctuation) def strip_punctuation(s): return s.tr...
en
0.892988
# scrapes Townes van Zandt lyrics # sample code so I don't have to remember all of this stuff # the next time I want to source some verses # get all <a> tags # filter out image links Quick and dirty snake-casing # special case, "Poncho & Lefty"
3.224555
3
chapter04/ifelse.py
persevere-in-coding-persist-in-learning/python2
3
11455
# coding=utf-8 """ 控制结构if elif else的研究 Version: 0.1 Author: huijz Date: 2020-08-24 """ # 例1:if的基本用法: flag = False name = 'huijz' if name == 'python': # 判断变量是否为 python flag = True # 条件成立时设置标志为真 print 'welcome boss' # 并输出欢迎信息 else: print name # 条件不成立时输出变量名称 # 例2:elif用法 num = 5 if num == 3: # 判断num的值 ...
# coding=utf-8 """ 控制结构if elif else的研究 Version: 0.1 Author: huijz Date: 2020-08-24 """ # 例1:if的基本用法: flag = False name = 'huijz' if name == 'python': # 判断变量是否为 python flag = True # 条件成立时设置标志为真 print 'welcome boss' # 并输出欢迎信息 else: print name # 条件不成立时输出变量名称 # 例2:elif用法 num = 5 if num == 3: # 判断num的值 ...
zh
0.792553
# coding=utf-8 控制结构if elif else的研究 Version: 0.1 Author: huijz Date: 2020-08-24 # 例1:if的基本用法: # 判断变量是否为 python # 条件成立时设置标志为真 # 并输出欢迎信息 # 条件不成立时输出变量名称 # 例2:elif用法 # 判断num的值 # 值小于零时输出 # 条件均不成立时输出 # 例3:if语句多个条件 # 判断值是否在0~10之间 # 输出结果: hello # 判断值是否在小于0或大于10 # 输出结果: unDefine # 判断值是否在0~5或者10~15之间 # 输出结果: unDefine # 例4:var = 1...
4.133384
4
setup.py
korymath/JANN
39
11456
<filename>setup.py<gh_stars>10-100 from setuptools import setup from setuptools import find_packages setup( name="Jann", version="4.0.0", description="Jann is a Nearest Neighbour retrieval-based chatbot.", author="<NAME>", author_email="<EMAIL>", license="MIT", url="https://github.com/kory...
<filename>setup.py<gh_stars>10-100 from setuptools import setup from setuptools import find_packages setup( name="Jann", version="4.0.0", description="Jann is a Nearest Neighbour retrieval-based chatbot.", author="<NAME>", author_email="<EMAIL>", license="MIT", url="https://github.com/kory...
none
1
1.239349
1
tests/scanner/scanners/ke_version_scanner_test.py
pombredanne/forseti-security
1
11457
# Copyright 2017 The Forseti Security Authors. All rights reserved. # # 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 ap...
# Copyright 2017 The Forseti Security Authors. All rights reserved. # # 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 ap...
en
0.836283
# Copyright 2017 The Forseti Security Authors. All rights reserved. # # 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 ap...
1.82394
2
metrics/utils.py
edwardyehuang/iSeg
4
11458
<filename>metrics/utils.py<gh_stars>1-10 # ================================================================ # MIT License # Copyright (c) 2021 edwardyehuang (https://github.com/edwardyehuang) # ================================================================ import tensorflow as tf from iseg.metrics.seg_metric_wrappe...
<filename>metrics/utils.py<gh_stars>1-10 # ================================================================ # MIT License # Copyright (c) 2021 edwardyehuang (https://github.com/edwardyehuang) # ================================================================ import tensorflow as tf from iseg.metrics.seg_metric_wrappe...
en
0.46553
# ================================================================ # MIT License # Copyright (c) 2021 edwardyehuang (https://github.com/edwardyehuang) # ================================================================
2.068644
2
src/core/stats.py
dynaryu/vaws
0
11459
import math def lognormal_mean(m, stddev): """ compute mean of log x with mean and std. of x Args: m: mean of x stddev: standard deviation of x Returns: mean of log x """ return math.log(m) - (0.5 * math.log(1.0 + (stddev * stddev) / (m * m))) def lognormal_stdde...
import math def lognormal_mean(m, stddev): """ compute mean of log x with mean and std. of x Args: m: mean of x stddev: standard deviation of x Returns: mean of log x """ return math.log(m) - (0.5 * math.log(1.0 + (stddev * stddev) / (m * m))) def lognormal_stdde...
en
0.641726
compute mean of log x with mean and std. of x Args: m: mean of x stddev: standard deviation of x Returns: mean of log x compute std. of log x with mean and std. of x Args: m: mean of x stddev: standard deviation of x Returns: std. of log x compute mean of x ...
3.864753
4
vim.d/vimfiles/bundle/taghighlight/plugin/TagHighlight/module/languages.py
lougxing/gbox
0
11460
#!/usr/bin/env python # Tag Highlighter: # Author: <NAME> <abudden _at_ gmail _dot_ com> # Copyright: Copyright (C) 2009-2013 <NAME> # Permission is hereby granted to use and distribute this code, # with or without modifications, provided that this copyright # notice is copied with i...
#!/usr/bin/env python # Tag Highlighter: # Author: <NAME> <abudden _at_ gmail _dot_ com> # Copyright: Copyright (C) 2009-2013 <NAME> # Permission is hereby granted to use and distribute this code, # with or without modifications, provided that this copyright # notice is copied with i...
en
0.786239
#!/usr/bin/env python # Tag Highlighter: # Author: <NAME> <abudden _at_ gmail _dot_ com> # Copyright: Copyright (C) 2009-2013 <NAME> # Permission is hereby granted to use and distribute this code, # with or without modifications, provided that this copyright # notice is copied with i...
2.3876
2
archive/bayes_sensor.py
robmarkcole/HASS-data-science
11
11461
""" Bayes sensor code split out from https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/binary_sensor/bayesian.py This module is used to explore the sensor. """ from collections import OrderedDict from const import * def update_probability(prior, prob_true, prob_false): """Update ...
""" Bayes sensor code split out from https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/binary_sensor/bayesian.py This module is used to explore the sensor. """ from collections import OrderedDict from const import * def update_probability(prior, prob_true, prob_false): """Update ...
en
0.737184
Bayes sensor code split out from https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/binary_sensor/bayesian.py This module is used to explore the sensor. Update probability using Bayes' rule. Set up the Bayesian Binary sensor. Modified from async_setup_platform. # Entity Represent a ...
3.183954
3
CoarseNet/MinutiaeNet_utils.py
khaihp98/minutiae
0
11462
<gh_stars>0 import os import glob import shutil import logging import matplotlib.pyplot as plt import numpy as np from scipy import ndimage, misc, signal, spatial from skimage.filters import gaussian, gabor_kernel import cv2 import math def mkdir(path): if not os.path.exists(path): os.makedirs(path) de...
import os import glob import shutil import logging import matplotlib.pyplot as plt import numpy as np from scipy import ndimage, misc, signal, spatial from skimage.filters import gaussian, gabor_kernel import cv2 import math def mkdir(path): if not os.path.exists(path): os.makedirs(path) def re_mkdir(p...
en
0.361317
# Bounding box # Rotation 2D gaussian mask - should give the same result as MATLAB's fspecial('gaussian',[shape],[sigma]) # Calculate Precision, Recall, F-score # Using L2 loss # Change to adapt to new annotation: old version. When training, comment it # y_pred[:,2] = -y_pred[:,2] # Satisfy the threshold # print('m...
2.268112
2
config/paths.py
fusic-com/flask-todo
34
11463
from settings import VAR_DIR CACHE=VAR_DIR/'cache'
from settings import VAR_DIR CACHE=VAR_DIR/'cache'
none
1
1.267767
1
Android.py
ChakradharG/Sudoku-Core
0
11464
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' #To suppress warnings thrown by tensorflow from time import sleep import numpy as np from cv2 import cv2 import pyautogui as pg import Sudoku_Core as SC import OCR s = 513//9 #Size of board//9 fs = 25 #Size of the final image def getBoard(): pg.click(266, 740) sl...
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' #To suppress warnings thrown by tensorflow from time import sleep import numpy as np from cv2 import cv2 import pyautogui as pg import Sudoku_Core as SC import OCR s = 513//9 #Size of board//9 fs = 25 #Size of the final image def getBoard(): pg.click(266, 740) sl...
en
0.793869
#To suppress warnings thrown by tensorflow #Size of board//9 #Size of the final image #Changing the difficulty to expert #(+3, -3) is a hack to remove border contours # vX = 42 + 55*(v-1) # vY = 843 # pg.moveTo(vX, vY, 0.1) #To use the numpad in the app # pg.click() #To send numbers from the keyboard
2.649513
3
app/model.py
kurapikaaaa/CITS3403Project
1
11465
from app import db, login from flask_login import UserMixin from datetime import datetime from flask import url_for, redirect from werkzeug.security import generate_password_hash, check_password_hash class users(UserMixin, db.Model): __tablename__ = 'users' id = db.Column(db.Integer, primary_key=True, autoinc...
from app import db, login from flask_login import UserMixin from datetime import datetime from flask import url_for, redirect from werkzeug.security import generate_password_hash, check_password_hash class users(UserMixin, db.Model): __tablename__ = 'users' id = db.Column(db.Integer, primary_key=True, autoinc...
de
0.873708
###################################################
2.631621
3
bert_multitask_learning/top.py
akashnd/bert-multitask-learning
1
11466
# AUTOGENERATED! DO NOT EDIT! File to edit: source_nbs/12_top.ipynb (unless otherwise specified). __all__ = ['empty_tensor_handling_loss', 'nan_loss_handling', 'create_dummy_if_empty', 'BaseTop', 'SequenceLabel', 'Classification', 'PreTrain', 'Seq2Seq', 'MultiLabelClassification', 'MaskLM'] # Cell import l...
# AUTOGENERATED! DO NOT EDIT! File to edit: source_nbs/12_top.ipynb (unless otherwise specified). __all__ = ['empty_tensor_handling_loss', 'nan_loss_handling', 'create_dummy_if_empty', 'BaseTop', 'SequenceLabel', 'Classification', 'PreTrain', 'Seq2Seq', 'MultiLabelClassification', 'MaskLM'] # Cell import l...
en
0.435866
# AUTOGENERATED! DO NOT EDIT! File to edit: source_nbs/12_top.ipynb (unless otherwise specified). # Cell # Cell # make the crf prediction has the same shape as non-crf prediction # sometimes the length of labels dose not equal to length of inputs # that's caused by tf.data.experimental.bucket_by_sequence_length in mult...
1.970649
2
strings/#387/strings.py
sharmarkei/DSA-Practice
0
11467
<reponame>sharmarkei/DSA-Practice<gh_stars>0 class Solution(object): def firstUniqChar(self, s): """ :type s: str :rtype: int """ dict_1 = {} for i in s: if i not in dict_1: dict_1[i] = 1 else: dict_1[i...
class Solution(object): def firstUniqChar(self, s): """ :type s: str :rtype: int """ dict_1 = {} for i in s: if i not in dict_1: dict_1[i] = 1 else: dict_1[i] += 1 print(dict_1) ...
en
0.328618
:type s: str :rtype: int
3.178265
3
challenge/utils/cancellation_code.py
AlonViz/IML.HUJI
0
11468
<reponame>AlonViz/IML.HUJI import re def process_cancellation_code(code): regex_days_before = "^(([0-9]+)D)(([0-9]+)N|([0-9]+)P)" regex_no_show = "(([0-9]+)P|([0-9]+)N)" options = re.split("_", code) final = [] for option in options: days_match = re.match(regex_days_before, option) ...
import re def process_cancellation_code(code): regex_days_before = "^(([0-9]+)D)(([0-9]+)N|([0-9]+)P)" regex_no_show = "(([0-9]+)P|([0-9]+)N)" options = re.split("_", code) final = [] for option in options: days_match = re.match(regex_days_before, option) if days_match: ...
en
0.799701
gives a numerical value to given cancellation code, return expected fine in percentage :return: returns 1 if the cancellation code contains a no-show fee, and 0 otherwise returns the expected fine in percentages after 'days' days from reservation. # convert cancellation policy to format (Days, Percentage) # return ...
2.852436
3
acronym/scoring.py
sigma67/acronym
340
11469
import re regex = re.compile('[^a-zA-Z]') def score_word(word, corpus=None): word = regex.sub('', word) # leave only alpha score = 0 consec_bonus = 2 for i, letter in enumerate(word): if letter.islower(): continue if i > 0 and word[i-1].upper(): score += conse...
import re regex = re.compile('[^a-zA-Z]') def score_word(word, corpus=None): word = regex.sub('', word) # leave only alpha score = 0 consec_bonus = 2 for i, letter in enumerate(word): if letter.islower(): continue if i > 0 and word[i-1].upper(): score += conse...
en
0.737926
# leave only alpha For each capitalized letter in the acronym: * 10 points if first letter in a word (with exception of first letter) * 3 point if second or last letter in a word * 1 point otherwise * N bonus points if begins an N-length valid sub-word (ex: multiVariable -> 8 bon...
3.827677
4
e2e_test.py
bartossh/hebbian_mirror
2
11470
<gh_stars>1-10 import requests num_of_iter = 2 data = open('./assets/test.jpg', 'rb').read() for i in range(0, num_of_iter): res = requests.get( url='http://0.0.0.0:8000/recognition/object/boxes_names' ) print("\n RESPONSE GET boxes names for test number {}: \n {}" .format(i, res.__dict__)...
import requests num_of_iter = 2 data = open('./assets/test.jpg', 'rb').read() for i in range(0, num_of_iter): res = requests.get( url='http://0.0.0.0:8000/recognition/object/boxes_names' ) print("\n RESPONSE GET boxes names for test number {}: \n {}" .format(i, res.__dict__)) res = req...
none
1
3.164782
3
appendix/auc_accuracy/train_nn_metric.py
rit-git/tagging
7
11471
<gh_stars>1-10 import argparse import os import torch import torch.nn as nn from torchtext.data import TabularDataset, BucketIterator from torchtext.data import Field from torchtext.vocab import Vectors, GloVe from tqdm import tqdm, trange import sys import os sys.path.insert(0, "../../pyfunctor") sys.path.insert(0, "...
import argparse import os import torch import torch.nn as nn from torchtext.data import TabularDataset, BucketIterator from torchtext.data import Field from torchtext.vocab import Vectors, GloVe from tqdm import tqdm, trange import sys import os sys.path.insert(0, "../../pyfunctor") sys.path.insert(0, "../../model") f...
en
0.370479
#from util.weight import WeightClassCSV # Load data # Initialize model # Train #label_weight = WeightClassCSV(args.dataset + "/train.csv").get_weights(['0', '1']) #loss_func = nn.CrossEntropyLoss(weight = torch.tensor(label_weight).to(device)) # Evaluate
2.306413
2
setup.py
teamproserve/pinkopy
0
11472
<filename>setup.py #!/usr/bin/env python from setuptools import setup, find_packages import sys try: import pypandoc readme = pypandoc.convert('README.md', 'rst') except(IOError, ImportError): with open('README.md') as f: readme = f.read() install_requires = [ 'cachetools>=1.1.5', 'reques...
<filename>setup.py #!/usr/bin/env python from setuptools import setup, find_packages import sys try: import pypandoc readme = pypandoc.convert('README.md', 'rst') except(IOError, ImportError): with open('README.md') as f: readme = f.read() install_requires = [ 'cachetools>=1.1.5', 'reques...
ru
0.26433
#!/usr/bin/env python
1.471859
1
scss/extension/core.py
xen0n/pyScss
0
11473
"""Extension for built-in Sass functionality.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from itertools import product import math import os.path from pathlib import PurePosixPath from six.moves import xrange ...
"""Extension for built-in Sass functionality.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from itertools import product import math import os.path from pathlib import PurePosixPath from six.moves import xrange ...
en
0.874623
Extension for built-in Sass functionality. Implementation of the core Sass import mechanism, which just looks for files on disk. # TODO virtually all of this is the same as the django stuff, except # for the bit that actually looks for and tries to open the file. # would be much easier if you could just stick a...
2.032262
2
pypy/module/cpyext/test/test_iterator.py
wdv4758h/mu-client-pypy
34
11474
from pypy.module.cpyext.test.test_api import BaseApiTest class TestIterator(BaseApiTest): def test_check_iter(self, space, api): assert api.PyIter_Check(space.iter(space.wrap("a"))) assert api.PyIter_Check(space.iter(space.newlist([]))) assert not api.PyIter_Check(space.w_type) ass...
from pypy.module.cpyext.test.test_api import BaseApiTest class TestIterator(BaseApiTest): def test_check_iter(self, space, api): assert api.PyIter_Check(space.iter(space.wrap("a"))) assert api.PyIter_Check(space.iter(space.newlist([]))) assert not api.PyIter_Check(space.w_type) ass...
none
1
2.237725
2
capsule_em/experiment.py
jrmendeshurb/google-research
6
11475
<reponame>jrmendeshurb/google-research # coding=utf-8 # Copyright 2019 The Google Research Authors. # # 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/LICE...
# coding=utf-8 # Copyright 2019 The Google Research Authors. # # 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 applicab...
en
0.714154
# coding=utf-8 # Copyright 2019 The Google Research Authors. # # 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 applicab...
1.721185
2
grafana/common/dashboards/aggregated/client_subnet_statistics_detail.py
MikeAT/visualizer
6
11476
# Copyright 2021 Internet Corporation for Assigned Names and Numbers. # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, you can obtain one at https://mozilla.org/MPL/2.0/. # # Developed by Sinodun IT (sinodun.com) # # Ag...
# Copyright 2021 Internet Corporation for Assigned Names and Numbers. # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, you can obtain one at https://mozilla.org/MPL/2.0/. # # Developed by Sinodun IT (sinodun.com) # # Ag...
en
0.419846
# Copyright 2021 Internet Corporation for Assigned Names and Numbers. # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, you can obtain one at https://mozilla.org/MPL/2.0/. # # Developed by Sinodun IT (sinodun.com) # # Ag...
1.731974
2
pylearn2/neuroimaging_utils/tutorials/nice/jobman/simple_train.py
rdevon/pylearn2
1
11477
<filename>pylearn2/neuroimaging_utils/tutorials/nice/jobman/simple_train.py """ Module to train a simple MLP for demo. """ from jobman.tools import expand from jobman.tools import flatten import logging import nice_experiment import numpy as np from os import path from pylearn2.config import yaml_parse from pylearn2....
<filename>pylearn2/neuroimaging_utils/tutorials/nice/jobman/simple_train.py """ Module to train a simple MLP for demo. """ from jobman.tools import expand from jobman.tools import flatten import logging import nice_experiment import numpy as np from os import path from pylearn2.config import yaml_parse from pylearn2....
en
0.495876
Module to train a simple MLP for demo.
2.473612
2
_Framework/Layer.py
isfopo/MacroPushScript
0
11478
<filename>_Framework/Layer.py #Embedded file name: /Users/versonator/Jenkins/live/output/Live/mac_64_static/Release/python-bundle/MIDI Remote Scripts/_Framework/Layer.py u""" Module implementing a way to resource-based access to controls in an unified interface dynamic. """ from __future__ import absolute_import, print...
<filename>_Framework/Layer.py #Embedded file name: /Users/versonator/Jenkins/live/output/Live/mac_64_static/Release/python-bundle/MIDI Remote Scripts/_Framework/Layer.py u""" Module implementing a way to resource-based access to controls in an unified interface dynamic. """ from __future__ import absolute_import, print...
en
0.913784
#Embedded file name: /Users/versonator/Jenkins/live/output/Live/mac_64_static/Release/python-bundle/MIDI Remote Scripts/_Framework/Layer.py Module implementing a way to resource-based access to controls in an unified interface dynamic. Simple owner that grabs a given layer until it's disconnected Client of the indivial...
2.241537
2
src/retrieve_exons_sequence_genomes.py
naturalis/brassicaceae-hybseq-pipeline
5
11479
<gh_stars>1-10 # retrieve_exons_sequence_genomes.py # This script is to retrieve exons from sequenced genomes which are also present in the reference genome (A. thaliana). # To identify the contigs from the sequenced genomes, each contig has to be retrieved from A. thaliana first. # Then, for each sequence query of A. ...
# retrieve_exons_sequence_genomes.py # This script is to retrieve exons from sequenced genomes which are also present in the reference genome (A. thaliana). # To identify the contigs from the sequenced genomes, each contig has to be retrieved from A. thaliana first. # Then, for each sequence query of A. thaliana, the q...
en
0.841209
# retrieve_exons_sequence_genomes.py # This script is to retrieve exons from sequenced genomes which are also present in the reference genome (A. thaliana). # To identify the contigs from the sequenced genomes, each contig has to be retrieved from A. thaliana first. # Then, for each sequence query of A. thaliana, the q...
2.904857
3
lexical/lexical.py
xmeng17/Malicious-URL-Detection
0
11480
import re class lexical(object): '''Lexical Features: Top Level domain (str) Number of dots in hostname (int) Average token length of hostname (float) Max token length of hostname (int) Average token length of path (float) Max token length of path (int) ''' def __init__(self): pass de...
import re class lexical(object): '''Lexical Features: Top Level domain (str) Number of dots in hostname (int) Average token length of hostname (float) Max token length of hostname (int) Average token length of path (float) Max token length of path (int) ''' def __init__(self): pass de...
en
0.587725
Lexical Features: Top Level domain (str) Number of dots in hostname (int) Average token length of hostname (float) Max token length of hostname (int) Average token length of path (float) Max token length of path (int) # returns number of dots # returns a list split by ‘/’, ‘?’, ‘.’, ‘=’, ‘-’ and ‘_’ # return...
3.700242
4
stacker/tests/providers/aws/test_interactive.py
GoodRx/stacker
1
11481
<gh_stars>1-10 import unittest from ....providers.aws.interactive import requires_replacement def generate_resource_change(replacement=True): resource_change = { "Action": "Modify", "Details": [], "LogicalResourceId": "Fake", "PhysicalResourceId": "arn:aws:fake", "Replaceme...
import unittest from ....providers.aws.interactive import requires_replacement def generate_resource_change(replacement=True): resource_change = { "Action": "Modify", "Details": [], "LogicalResourceId": "Fake", "PhysicalResourceId": "arn:aws:fake", "Replacement": "True" if ...
none
1
3.068632
3
setup.py
digicert/digicert_express
2
11482
from setuptools import setup, find_packages def readme(): with open('README.rst') as f: return f.read() setup( name='digicert-express', version='1.1dev2', description='Express Install for DigiCert, Inc.', long_description=readme(), classifiers=[ 'Development Status :: 3 - Alpha...
from setuptools import setup, find_packages def readme(): with open('README.rst') as f: return f.read() setup( name='digicert-express', version='1.1dev2', description='Express Install for DigiCert, Inc.', long_description=readme(), classifiers=[ 'Development Status :: 3 - Alpha...
en
0.925986
# prefer OS install but we can try here, too
1.330053
1
pytorch/plane.py
NunoEdgarGFlowHub/autoregressive-energy-machines
83
11483
import argparse import json import numpy as np import os import torch import data_ import models import utils from matplotlib import cm, pyplot as plt from tensorboardX import SummaryWriter from torch import optim from torch.utils import data from tqdm import tqdm from utils import io parser = argparse.ArgumentPars...
import argparse import json import numpy as np import os import torch import data_ import models import utils from matplotlib import cm, pyplot as plt from tensorboardX import SummaryWriter from torch import optim from torch.utils import data from tqdm import tqdm from utils import io parser = argparse.ArgumentPars...
en
0.682945
# CUDA # data # MADE # energy net # proposal # optimization # logging and checkpoints # reproducibility # Generate data # Generate test grid data # various dimensions for autoregressive and energy nets # D # K + 3M # Create MADE # create energy net # create AEM # make optimizer # create summary writer and write to log ...
2.109825
2
music/music.py
spacerunaway/world_recoder
0
11484
<reponame>spacerunaway/world_recoder import sys sys.path.append('../utils') from utils import * from doubly_linkedlist import * def link_chords(chordprogression): """ Chord progression is a sequences of chords. A valid linked_chords can be one of the following: 1: the chord name(str) in CHORD dict ...
import sys sys.path.append('../utils') from utils import * from doubly_linkedlist import * def link_chords(chordprogression): """ Chord progression is a sequences of chords. A valid linked_chords can be one of the following: 1: the chord name(str) in CHORD dict 2: the key(type Key) and a music ...
en
0.670304
Chord progression is a sequences of chords. A valid linked_chords can be one of the following: 1: the chord name(str) in CHORD dict 2: the key(type Key) and a music have to a signal of start and end. >>> c_p1 = [START,C_Major,'C','Am','F','G','C','Am','F','G7',END] >>> c_p2 = [START,C_Major,'C'...
3.41576
3
azure-mgmt/tests/test_mgmt_documentdb.py
v-Ajnava/azure-sdk-for-python
4
11485
# coding: utf-8 #------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #---------------------------------------------------------------------...
# coding: utf-8 #------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #---------------------------------------------------------------------...
en
0.749828
# coding: utf-8 #------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #-----------------------------------------------------------------------...
1.999066
2
config.py
somritabanerjee/speedplusbaseline
0
11486
import argparse PROJROOTDIR = {'mac': '/Users/taehapark/SLAB/speedplusbaseline', 'linux': '/home/somrita/Documents/Satellite_Pose_Estimation/speedplusbaseline'} DATAROOTDIR = {'mac': '/Users/taehapark/SLAB/speedplus/data/datasets', 'linux': '/home/somrita/Documents/Satellite_Pose_Estim...
import argparse PROJROOTDIR = {'mac': '/Users/taehapark/SLAB/speedplusbaseline', 'linux': '/home/somrita/Documents/Satellite_Pose_Estimation/speedplusbaseline'} DATAROOTDIR = {'mac': '/Users/taehapark/SLAB/speedplus/data/datasets', 'linux': '/home/somrita/Documents/Satellite_Pose_Estim...
en
0.220084
# ------------------------------------------------------------------------------------------ # Basic directories and names # ------------------------------------------------------------------------------------------ # Model config. # KRN-specific # SPN-specific # SPN-specific # -----------------------------------------...
2.021374
2
h1/api/insight_project_journal_api.py
hyperonecom/h1-client-python
0
11487
""" HyperOne HyperOne API # noqa: E501 The version of the OpenAPI document: 0.1.0 Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 from h1.api_client import ApiClient, Endpoint as _Endpoint from h1.model_utils import ( # noqa: F401 check_allowe...
""" HyperOne HyperOne API # noqa: E501 The version of the OpenAPI document: 0.1.0 Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 from h1.api_client import ApiClient, Endpoint as _Endpoint from h1.model_utils import ( # noqa: F401 check_allowe...
en
0.748489
HyperOne HyperOne API # noqa: E501 The version of the OpenAPI document: 0.1.0 Generated by: https://openapi-generator.tech # noqa: F401 # noqa: F401 # noqa: F401 NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. Create ins...
1.798925
2
forms/views.py
urchinpro/L2-forms
0
11488
<filename>forms/views.py from django.http import HttpResponse from django.utils.module_loading import import_string def pdf(request): """ Get form's number (decimal type: 101.15 - where "101" is form's group and "15"-number itsels). Can't use 1,2,3,4,5,6,7,8,9 for number itsels - which stands after the po...
<filename>forms/views.py from django.http import HttpResponse from django.utils.module_loading import import_string def pdf(request): """ Get form's number (decimal type: 101.15 - where "101" is form's group and "15"-number itsels). Can't use 1,2,3,4,5,6,7,8,9 for number itsels - which stands after the po...
en
0.763044
Get form's number (decimal type: 101.15 - where "101" is form's group and "15"-number itsels). Can't use 1,2,3,4,5,6,7,8,9 for number itsels - which stands after the point. Bacause in database field store in decimal format xxx.yy - two number after dot, and active status. Must use: 01,02,03-09,10,11,12-19,2...
2.170962
2
main.py
code-aifarmer/Python-EXE-maker
2
11489
<gh_stars>1-10 #!/usr/bin/env python import PySimpleGUI as sg import cv2 import subprocess import shutil import os import sys # Demonstrates a number of PySimpleGUI features including: # Default element size # auto_size_buttons # Button # Dictionary return values # update of elements in form (Text, Input) def...
#!/usr/bin/env python import PySimpleGUI as sg import cv2 import subprocess import shutil import os import sys # Demonstrates a number of PySimpleGUI features including: # Default element size # auto_size_buttons # Button # Dictionary return values # update of elements in form (Text, Input) def runCommand(cmd...
en
0.545238
#!/usr/bin/env python # Demonstrates a number of PySimpleGUI features including: # Default element size # auto_size_buttons # Button # Dictionary return values # update of elements in form (Text, Input) run shell command @param cmd: command to execute @param timeout: timeout for command execution @return: ...
2.753041
3
seisflows/system/lsf_sm.py
jpvantassel/seisflows
97
11490
# # This is Seisflows # # See LICENCE file # ############################################################################### raise NotImplementedError
# # This is Seisflows # # See LICENCE file # ############################################################################### raise NotImplementedError
de
0.683743
# # This is Seisflows # # See LICENCE file # ###############################################################################
1.023166
1
data/objects/sample.py
predictive-analytics-lab/tiny-comparison-framework
0
11491
<filename>data/objects/sample.py from data.objects.data import Data class Sample(Data): """ A way to sample from a dataset for testing purposes. """ def __init__(self, data, num = 100): self.data = data self.dataset_name = data.get_dataset_name() self.class_attr = data.get_class...
<filename>data/objects/sample.py from data.objects.data import Data class Sample(Data): """ A way to sample from a dataset for testing purposes. """ def __init__(self, data, num = 100): self.data = data self.dataset_name = data.get_dataset_name() self.class_attr = data.get_class...
en
0.845182
A way to sample from a dataset for testing purposes. # sigh # sigh
3.318593
3
parkrundata/views.py
remarkablerocket/parkrundata
0
11492
<reponame>remarkablerocket/parkrundata # -*- coding: utf-8 -*- from rest_framework import viewsets from rest_framework.permissions import IsAuthenticatedOrReadOnly from .models import Country, Event from .serializers import CountrySerializer, EventSerializer class CountryViewSet(viewsets.ModelViewSet): queryset...
# -*- coding: utf-8 -*- from rest_framework import viewsets from rest_framework.permissions import IsAuthenticatedOrReadOnly from .models import Country, Event from .serializers import CountrySerializer, EventSerializer class CountryViewSet(viewsets.ModelViewSet): queryset = Country.objects.all() serializer...
en
0.769321
# -*- coding: utf-8 -*-
1.936095
2
spearmint/models/gp_classifier.py
jatinarora2409/Spearmint
0
11493
<gh_stars>0 # -*- coding: utf-8 -*- # Spearmint # # Academic and Non-Commercial Research Use Software License and Terms # of Use # # Spearmint is a software package to perform Bayesian optimization # according to specific algorithms (the “Software”). The Software is # designed to automatically run experiments (thus th...
# -*- coding: utf-8 -*- # Spearmint # # Academic and Non-Commercial Research Use Software License and Terms # of Use # # Spearmint is a software package to perform Bayesian optimization # according to specific algorithms (the “Software”). The Software is # designed to automatically run experiments (thus the code name ...
en
0.810689
# -*- coding: utf-8 -*- # Spearmint # # Academic and Non-Commercial Research Use Software License and Terms # of Use # # Spearmint is a software package to perform Bayesian optimization # according to specific algorithms (the “Software”). The Software is # designed to automatically run experiments (thus the code name ...
1.505847
2
pycom_lopy4_LoRaBattMonitor/transmitter/main.py
AidanTek/Fab-Cre8_IoT
0
11494
from machine import Pin, ADC from network import LoRa import socket from utime import sleep # Use a pin for a 'config' mode configPin = Pin('P21', Pin.IN, Pin.PULL_UP) # Create an ADC object adc = ADC() # vbatt pin: vbatt = adc.channel(attn=1, pin='P16') def battConversion(): adcVoltage = vbatt() voltage = ...
from machine import Pin, ADC from network import LoRa import socket from utime import sleep # Use a pin for a 'config' mode configPin = Pin('P21', Pin.IN, Pin.PULL_UP) # Create an ADC object adc = ADC() # vbatt pin: vbatt = adc.channel(attn=1, pin='P16') def battConversion(): adcVoltage = vbatt() voltage = ...
en
0.505129
# Use a pin for a 'config' mode # Create an ADC object # vbatt pin: # Initialise LoRa in LoRa mode # For Europe, use LoRa.EU868 # Create a raw LoRa socket # Check the Config pin: # Send some data # Otherwise, we are in 'config' so exit to REPL
2.861895
3
scrapi/harvesters/lwbin.py
wearpants/scrapi
34
11495
""" A Lake Winnipeg Basin Information Network (BIN) harvester for the SHARE project Example API request: http://130.179.67.140/api/3/action/package_search?q= (problematic) http://130.179.67.140/api/3/action/current_package_list_with_resources (currently using) It oddly returns 5 more datasets than all searchable ones ...
""" A Lake Winnipeg Basin Information Network (BIN) harvester for the SHARE project Example API request: http://130.179.67.140/api/3/action/package_search?q= (problematic) http://130.179.67.140/api/3/action/current_package_list_with_resources (currently using) It oddly returns 5 more datasets than all searchable ones ...
en
0.811248
A Lake Winnipeg Basin Information Network (BIN) harvester for the SHARE project Example API request: http://130.179.67.140/api/3/action/package_search?q= (problematic) http://130.179.67.140/api/3/action/current_package_list_with_resources (currently using) It oddly returns 5 more datasets than all searchable ones on L...
2.134467
2
catalog/bindings/gmd/point.py
NIVANorge/s-enda-playground
0
11496
from dataclasses import dataclass from bindings.gmd.point_type import PointType __NAMESPACE__ = "http://www.opengis.net/gml" @dataclass class Point(PointType): """A Point is defined by a single coordinate tuple. The direct position of a point is specified by the pos element which is of type DirectPositi...
from dataclasses import dataclass from bindings.gmd.point_type import PointType __NAMESPACE__ = "http://www.opengis.net/gml" @dataclass class Point(PointType): """A Point is defined by a single coordinate tuple. The direct position of a point is specified by the pos element which is of type DirectPositi...
en
0.907625
A Point is defined by a single coordinate tuple. The direct position of a point is specified by the pos element which is of type DirectPositionType.
3.14027
3
hknweb/exams/migrations/0019_auto_20200413_0212.py
AndrewKe/hknweb
0
11497
<gh_stars>0 # Generated by Django 2.2.8 on 2020-04-13 09:12 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('exams', '0018_auto_20200412_1715'), ] operations = [ migrations.CreateModel( name='...
# Generated by Django 2.2.8 on 2020-04-13 09:12 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('exams', '0018_auto_20200412_1715'), ] operations = [ migrations.CreateModel( name='ExamChoice',...
en
0.813168
# Generated by Django 2.2.8 on 2020-04-13 09:12
1.605549
2
tools/linear_algebra/preconditioners/Jacobi.py
mathischeap/mifem
1
11498
<gh_stars>1-10 # -*- coding: utf-8 -*- """Jacobian preconditioner. """ from root.config.main import * from scipy import sparse as spspa from tools.linear_algebra.preconditioners.base import Preconditioner class JacobiPreconditioner(Preconditioner): """""" def __init__(self, A): """""" super(Ja...
# -*- coding: utf-8 -*- """Jacobian preconditioner. """ from root.config.main import * from scipy import sparse as spspa from tools.linear_algebra.preconditioners.base import Preconditioner class JacobiPreconditioner(Preconditioner): """""" def __init__(self, A): """""" super(JacobiPreconditio...
en
0.641912
# -*- coding: utf-8 -*- Jacobian preconditioner.
2.418226
2
social_redirects/models.py
JoshZero87/site
4
11499
<reponame>JoshZero87/site from django.contrib.sites.models import Site from django.db import models class Redirect(models.Model): title = models.CharField(max_length=200) description = models.CharField(max_length=1024, blank=True, null=True) social_image = models.ImageField(null=True, blank=True) old...
from django.contrib.sites.models import Site from django.db import models class Redirect(models.Model): title = models.CharField(max_length=200) description = models.CharField(max_length=1024, blank=True, null=True) social_image = models.ImageField(null=True, blank=True) old_path = models.CharField(m...
none
1
2.18057
2