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
taller_estructuras_de_control_selectivas/ejercicio_13.py
JMosqueraM/algoritmos_y_programacion
0
9700
# Desarrolle un un programa que reciba la fecha de nacimiento # de una persona, y como salida, indique el nombre del signo del # zodiaco correspondiente, ademas de su edad def zodiaco(DD, MM): if (((DD >= 22) and (MM == 11)) or ((DD <=21) and (MM == 12))): return("Sagitario") if (((DD >= 22) and (MM ==...
# Desarrolle un un programa que reciba la fecha de nacimiento # de una persona, y como salida, indique el nombre del signo del # zodiaco correspondiente, ademas de su edad def zodiaco(DD, MM): if (((DD >= 22) and (MM == 11)) or ((DD <=21) and (MM == 12))): return("Sagitario") if (((DD >= 22) and (MM ==...
es
0.969296
# Desarrolle un un programa que reciba la fecha de nacimiento # de una persona, y como salida, indique el nombre del signo del # zodiaco correspondiente, ademas de su edad
3.627526
4
assignment3/crawler/spiders/benchmark_spider.py
vhazali/cs5331
8
9701
import re, scrapy from crawler.items import * class BenchmarkSpider(scrapy.Spider): drop_params = True # Spider name, for use with the scrapy crawl command name = "benchmarks" # Constants to get url parts FULL, PROTOCOL, USER, PASSWORD, SUBDOMAIN, DOMAIN, TOP_LEVEL_DOMAIN, PORT_NUM, PATH, PAGE, GE...
import re, scrapy from crawler.items import * class BenchmarkSpider(scrapy.Spider): drop_params = True # Spider name, for use with the scrapy crawl command name = "benchmarks" # Constants to get url parts FULL, PROTOCOL, USER, PASSWORD, SUBDOMAIN, DOMAIN, TOP_LEVEL_DOMAIN, PORT_NUM, PATH, PAGE, GE...
en
0.74076
# Spider name, for use with the scrapy crawl command # Constants to get url parts # List of start urls to start crawling # 'https://app1.com', # 'https://app2.com', # 'https://app3.com', # 'https://app4.com', # 'https://app5.com', # 'https://app6.com', # 'https://app7.com', # 'https://app8.com', # 'https://app9.com', #...
2.709682
3
octavia_tempest_plugin/services/load_balancer/v2/listener_client.py
NeCTAR-RC/octavia-tempest-plugin
0
9702
# Copyright 2017 GoDaddy # # 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 ...
# Copyright 2017 GoDaddy # # 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 ...
en
0.872992
# Copyright 2017 GoDaddy # # 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 ...
1.657333
2
ryu/gui/views/router_address_delete.py
isams1/Thesis
3
9703
import re import logging import httplib import view_base from models import rt_proxy LOG = logging.getLogger('ryu.gui') class RtAddrDel(view_base.ViewBase): def __init__(self, host, port, dpid, address_id, status=None): super(RtAddrDel, self).__init__() self.host = host self.port = port ...
import re import logging import httplib import view_base from models import rt_proxy LOG = logging.getLogger('ryu.gui') class RtAddrDel(view_base.ViewBase): def __init__(self, host, port, dpid, address_id, status=None): super(RtAddrDel, self).__init__() self.host = host self.port = port ...
en
0.962632
# set rule
2.243698
2
tests/util/test_helper.py
TobiasRasbold/pywrangler
14
9704
"""This module contains tests for the helper module. """ from pywrangler.util.helper import get_param_names def test_get_param_names(): def func(): pass assert get_param_names(func) == [] def func1(a, b=4, c=6): pass assert get_param_names(func1) == ["a", "b", "c"] assert get...
"""This module contains tests for the helper module. """ from pywrangler.util.helper import get_param_names def test_get_param_names(): def func(): pass assert get_param_names(func) == [] def func1(a, b=4, c=6): pass assert get_param_names(func1) == ["a", "b", "c"] assert get...
en
0.431578
This module contains tests for the helper module.
2.586443
3
Python-Files/model_conversion/convert_to_tflite.py
jcgeo9/ML-For-Fish-Recognition
0
9705
<reponame>jcgeo9/ML-For-Fish-Recognition # ============================================================================= # Created By : <NAME> # Project : Machine Learning for Fish Recognition (Individual Project) # ============================================================================= # Description : File ...
# ============================================================================= # Created By : <NAME> # Project : Machine Learning for Fish Recognition (Individual Project) # ============================================================================= # Description : File in order to convert saved models to .tfli...
en
0.682351
# ============================================================================= # Created By : <NAME> # Project : Machine Learning for Fish Recognition (Individual Project) # ============================================================================= # Description : File in order to convert saved models to .tfli...
3.26676
3
python3/sparkts/test/test_datetimeindex.py
hedibejaoui/spark-timeseries
0
9706
<reponame>hedibejaoui/spark-timeseries<gh_stars>0 from .test_utils import PySparkTestCase from sparkts.datetimeindex import * import pandas as pd class DateTimeIndexTestCase(PySparkTestCase): def test_frequencies(self): bd = BusinessDayFrequency(1, 1, self.sc) self.assertEqual(bd.days(), 1) ...
from .test_utils import PySparkTestCase from sparkts.datetimeindex import * import pandas as pd class DateTimeIndexTestCase(PySparkTestCase): def test_frequencies(self): bd = BusinessDayFrequency(1, 1, self.sc) self.assertEqual(bd.days(), 1) hf = HourFrequency(4, self.sc) s...
none
1
2.410657
2
src/listIntersect/inter.py
rajitbanerjee/leetcode
0
9707
# Definition for singly-linked list. class ListNode: def __init__(self, x): self.val = x self.next = None class Solution: def getIntersectionNode(self, headA: ListNode, headB: ListNode) -> ListNode: seen = set() curr = headA while curr: seen.add(curr) ...
# Definition for singly-linked list. class ListNode: def __init__(self, x): self.val = x self.next = None class Solution: def getIntersectionNode(self, headA: ListNode, headB: ListNode) -> ListNode: seen = set() curr = headA while curr: seen.add(curr) ...
en
0.620171
# Definition for singly-linked list.
3.581728
4
photon_stream_production/tests/test_drs_run_assignment.py
fact-project/photon_stream_production
0
9708
import numpy as np import photon_stream as ps import photon_stream_production as psp import pkg_resources import os runinfo_path = pkg_resources.resource_filename( 'photon_stream_production', os.path.join('tests', 'resources', 'runinfo_20161115_to_20170103.csv') ) drs_fRunID_for_obs_run = psp.drs_run._drs_fRu...
import numpy as np import photon_stream as ps import photon_stream_production as psp import pkg_resources import os runinfo_path = pkg_resources.resource_filename( 'photon_stream_production', os.path.join('tests', 'resources', 'runinfo_20161115_to_20170103.csv') ) drs_fRunID_for_obs_run = psp.drs_run._drs_fRu...
none
1
2.09793
2
accounts/migrations/0001_initial.py
vikifox/CMDB
16
9709
# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-04-18 05:56 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('cmdb', '0001_initial'), ('appc...
# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-04-18 05:56 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('cmdb', '0001_initial'), ('appc...
en
0.583576
# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-04-18 05:56
1.736094
2
autoscaler/azure.py
gabrieladt/kops-ec2-autoscaler
0
9710
import http import logging from typing import List, Tuple, MutableMapping from datetime import datetime import re from requests.packages.urllib3 import Retry import autoscaler.utils as utils from autoscaler.autoscaling_groups import AutoScalingGroup from autoscaler.azure_api import AzureApi, AzureScaleSet, AzureScale...
import http import logging from typing import List, Tuple, MutableMapping from datetime import datetime import re from requests.packages.urllib3 import Retry import autoscaler.utils as utils from autoscaler.autoscaling_groups import AutoScalingGroup from autoscaler.azure_api import AzureApi, AzureScaleSet, AzureScale...
en
0.86913
XXX: Azure sometimes sends us a Retry-After: 1200, even when we still have quota, causing our client to appear to hang. Ignore them and just retry after 30secs # Appears as an unbounded scale set. Currently, Azure Scale Sets have a limit of 100 hosts. # HACK: for matching node selectors sets the desired capacity of...
2.186733
2
sort_insertion.py
rachitmishra/45
0
9711
""" Insertion Sort Approach: Loop Complexity: O(n2) """ def sort_insertion(input_arr): print("""""""""""""""""""""""""") print("input " + str(input_arr)) print("""""""""""""""""""""""""") ln = len(input_arr) i = 1 # Assuming first element is sorted while i < ln: # n times c = inpu...
""" Insertion Sort Approach: Loop Complexity: O(n2) """ def sort_insertion(input_arr): print("""""""""""""""""""""""""") print("input " + str(input_arr)) print("""""""""""""""""""""""""") ln = len(input_arr) i = 1 # Assuming first element is sorted while i < ln: # n times c = inpu...
en
0.709097
Insertion Sort Approach: Loop Complexity: O(n2) # Assuming first element is sorted # n times # n times
4.170901
4
Python2/tareas/tarea_7.py
eveiramirez/python_class
0
9712
<reponame>eveiramirez/python_class<filename>Python2/tareas/tarea_7.py """ NAME tarea_7.py VERSION [1.0] AUTHOR <NAME> CONTACT <EMAIL> GITHUB https://github.com/eveiramirez/python_class/blob/master/Python2/tareas/tarea_7.py DESCRIPTION Este programa contiene arrays e...
""" NAME tarea_7.py VERSION [1.0] AUTHOR <NAME> CONTACT <EMAIL> GITHUB https://github.com/eveiramirez/python_class/blob/master/Python2/tareas/tarea_7.py DESCRIPTION Este programa contiene arrays estructurados para los arrays creados en el ejercicio 1, los cu...
es
0.833208
NAME tarea_7.py VERSION [1.0] AUTHOR <NAME> CONTACT <EMAIL> GITHUB https://github.com/eveiramirez/python_class/blob/master/Python2/tareas/tarea_7.py DESCRIPTION Este programa contiene arrays estructurados para los arrays creados en el ejercicio 1, los cuales ...
2.922862
3
iguanas/pipeline/_base_pipeline.py
paypal/Iguanas
20
9713
<gh_stars>10-100 """ Base pipeline class. Main rule generator classes inherit from this one. """ from copy import deepcopy from typing import List, Tuple, Union, Dict from iguanas.pipeline.class_accessor import ClassAccessor from iguanas.utils.typing import PandasDataFrameType, PandasSeriesType import iguanas.utils.uti...
""" Base pipeline class. Main rule generator classes inherit from this one. """ from copy import deepcopy from typing import List, Tuple, Union, Dict from iguanas.pipeline.class_accessor import ClassAccessor from iguanas.utils.typing import PandasDataFrameType, PandasSeriesType import iguanas.utils.utils as utils from ...
en
0.617714
Base pipeline class. Main rule generator classes inherit from this one. Base pipeline class. Main pipeline classes inherit from this one. Parameters ---------- steps : List[Tuple[str, object]] The steps to be applied as part of the pipeline. verbose : int, optional Controls the v...
2.562291
3
test_activity_merger.py
AlexanderMakarov/activitywatch-ets
0
9714
import unittest import datetime from parameterized import parameterized from activity_merger import Interval from aw_core.models import Event from typing import List, Tuple def _build_datetime(seed: int) -> datetime.datetime: return datetime.datetime(2000, 1, seed, seed, 0, 0).astimezone(datetime.timezone.utc) ...
import unittest import datetime from parameterized import parameterized from activity_merger import Interval from aw_core.models import Event from typing import List, Tuple def _build_datetime(seed: int) -> datetime.datetime: return datetime.datetime(2000, 1, seed, seed, 0, 0).astimezone(datetime.timezone.utc) ...
en
0.652758
Builds intervals linked list from the list of tuples. Doesn't check parameters. :param data: List of tuples (day of start, flag to return `Interval` from the function, duration). :return: Chosen interval.
2.305334
2
pommerman/agents/player_agent.py
alekseynp/playground
8
9715
""" NOTE: There are a few minor complications to fluid human control which make this code a little more involved than trivial. 1. Key press-release cycles can be, and often are, faster than one tick of the game/simulation, but the player still wants that cycle to count, i.e. to lay a bomb! 2. When holding down ...
""" NOTE: There are a few minor complications to fluid human control which make this code a little more involved than trivial. 1. Key press-release cycles can be, and often are, faster than one tick of the game/simulation, but the player still wants that cycle to count, i.e. to lay a bomb! 2. When holding down ...
en
0.949811
NOTE: There are a few minor complications to fluid human control which make this code a little more involved than trivial. 1. Key press-release cycles can be, and often are, faster than one tick of the game/simulation, but the player still wants that cycle to count, i.e. to lay a bomb! 2. When holding down a ke...
3.976842
4
tests/rest/test_rest.py
sapshah-cisco/cobra
93
9716
<filename>tests/rest/test_rest.py # Copyright 2015 Cisco Systems, 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 ...
<filename>tests/rest/test_rest.py # Copyright 2015 Cisco Systems, 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 ...
en
0.831536
# Copyright 2015 Cisco Systems, 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 ...
1.850782
2
spanglish/tests/fixtures/models/language.py
omaraljazairy/FedalAPI
0
9717
<gh_stars>0 """ fixtures that return an sql statement with a list of values to be inserted.""" def load_language(): """ return the sql and values of the insert queuery.""" sql = """ INSERT INTO Spanglish_Test.Language ( `name`, `iso-639-1` ) VALUES (%s, ...
""" fixtures that return an sql statement with a list of values to be inserted.""" def load_language(): """ return the sql and values of the insert queuery.""" sql = """ INSERT INTO Spanglish_Test.Language ( `name`, `iso-639-1` ) VALUES (%s, %s) ...
en
0.445565
fixtures that return an sql statement with a list of values to be inserted. return the sql and values of the insert queuery. INSERT INTO Spanglish_Test.Language ( `name`, `iso-639-1` ) VALUES (%s, %s)
2.761919
3
main-hs2.py
tradewartracker/phase-one-product-hs2
0
9718
import datetime as dt from os.path import dirname, join import numpy as np import pandas as pd import pyarrow as pa import pyarrow.parquet as pq from bokeh.io import curdoc from bokeh.layouts import column, gridplot, row from bokeh.models import ColumnDataSource, DataRange1d, Select, HoverTool, Panel, Tabs, LinearC...
import datetime as dt from os.path import dirname, join import numpy as np import pandas as pd import pyarrow as pa import pyarrow.parquet as pq from bokeh.io import curdoc from bokeh.layouts import column, gridplot, row from bokeh.models import ColumnDataSource, DataRange1d, Select, HoverTool, Panel, Tabs, LinearC...
en
0.622527
################################################################################# # This just loads in the data... # Alot of this was built of this "cross-fire demo" # https://github.com/bokeh/bokeh/blob/branch-2.3/examples/app/crossfilter/main.py #print(options) ########################################################...
2.317365
2
aiohttp_middlewares/https.py
alxpy/aiohttp-middlewares
34
9719
<reponame>alxpy/aiohttp-middlewares<filename>aiohttp_middlewares/https.py """ ================ HTTPS Middleware ================ Change scheme for current request when aiohttp application deployed behind reverse proxy with HTTPS enabled. Usage ===== .. code-block:: python from aiohttp import web from aiohtt...
""" ================ HTTPS Middleware ================ Change scheme for current request when aiohttp application deployed behind reverse proxy with HTTPS enabled. Usage ===== .. code-block:: python from aiohttp import web from aiohttp_middlewares import https_middleware # Basic usage app = web.App...
en
0.616694
================ HTTPS Middleware ================ Change scheme for current request when aiohttp application deployed behind reverse proxy with HTTPS enabled. Usage ===== .. code-block:: python from aiohttp import web from aiohttp_middlewares import https_middleware # Basic usage app = web.Applica...
2.383646
2
show/drawing.py
nohamanona/poke-auto-fuka
5
9720
<reponame>nohamanona/poke-auto-fuka<filename>show/drawing.py import cv2 import numpy as np class DrawingClass(object): def __init__(self): self.draw_command ='None' self.frame_count = 0 def drawing(self, frame, fps, num_egg, htc_egg, state): cv2.putText(frame, 'FPS: {:.2f}'.form...
import cv2 import numpy as np class DrawingClass(object): def __init__(self): self.draw_command ='None' self.frame_count = 0 def drawing(self, frame, fps, num_egg, htc_egg, state): cv2.putText(frame, 'FPS: {:.2f}'.format(fps), (10, 30), cv2.FONT_HERSHEY_SIMP...
en
0.49165
#print('draw',command) #stick #button
2.828963
3
backtest.py
YangTaoCN/IntroNeuralNetworks
0
9721
import pandas_datareader.data as pdr import yfinance as fix import numpy as np fix.pdr_override() def back_test(strategy, seq_len, ticker, start_date, end_date, dim): """ A simple back test for a given date period :param strategy: the chosen strategy. Note to have already formed the model, and fitted with...
import pandas_datareader.data as pdr import yfinance as fix import numpy as np fix.pdr_override() def back_test(strategy, seq_len, ticker, start_date, end_date, dim): """ A simple back test for a given date period :param strategy: the chosen strategy. Note to have already formed the model, and fitted with...
en
0.720146
A simple back test for a given date period :param strategy: the chosen strategy. Note to have already formed the model, and fitted with training data. :param seq_len: length of the days used for prediction :param ticker: company ticker :param start_date: starting date :type start_date: "YYYY-mm-dd" ...
3.334843
3
src/tespy/components/subsystems.py
jbueck/tespy
0
9722
# -*- coding: utf-8 """Module for custom component groups. It is possible to create subsystems of component groups in tespy. The subsystem class is the base class for custom subsystems. This file is part of project TESPy (github.com/oemof/tespy). It's copyrighted by the contributors recorded in the version control ...
# -*- coding: utf-8 """Module for custom component groups. It is possible to create subsystems of component groups in tespy. The subsystem class is the base class for custom subsystems. This file is part of project TESPy (github.com/oemof/tespy). It's copyrighted by the contributors recorded in the version control ...
en
0.600084
# -*- coding: utf-8 Module for custom component groups. It is possible to create subsystems of component groups in tespy. The subsystem class is the base class for custom subsystems. This file is part of project TESPy (github.com/oemof/tespy). It's copyrighted by the contributors recorded in the version control hist...
2.928988
3
fairscale/optim/oss.py
blefaudeux/fairscale
1
9723
<filename>fairscale/optim/oss.py # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. import copy import logging from typing import TYPE_CHECKING, Any, Callable, List, Option...
<filename>fairscale/optim/oss.py # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. import copy import logging from typing import TYPE_CHECKING, Any, Callable, List, Option...
en
0.861915
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. Wraps an arbitrary :class:`optim.Optimizer <torch.optim.Optimizer>` optimizer and shards its state as described by ZeR...
2.09564
2
setup.py
ninezerozeronine/raytracing-one-weekend
0
9724
from setuptools import setup, find_packages setup( name="raytracing-one-weekend", version="0.0.0", author="<NAME>", author_email="<EMAIL>", description="A raytracer achievable in a weekend.", url="https://github.com/ninezerozeronine/raytracing-one-weekend", install_requires=[ "Pillo...
from setuptools import setup, find_packages setup( name="raytracing-one-weekend", version="0.0.0", author="<NAME>", author_email="<EMAIL>", description="A raytracer achievable in a weekend.", url="https://github.com/ninezerozeronine/raytracing-one-weekend", install_requires=[ "Pillo...
none
1
1.288188
1
homepage/urls.py
r0kym/SNI-backend
1
9725
<gh_stars>1-10 """ URLconf of the homepage """ from django.urls import path, include from . import views urlpatterns = [ path('', views.home, name='home'), path('auth', views.auth, name='auth'), path('auth/public', views.auth_public, name='auth-public'), path('auth/full', views.auth_full, name='aut...
""" URLconf of the homepage """ from django.urls import path, include from . import views urlpatterns = [ path('', views.home, name='home'), path('auth', views.auth, name='auth'), path('auth/public', views.auth_public, name='auth-public'), path('auth/full', views.auth_full, name='auth-full'), p...
en
0.797408
URLconf of the homepage
2.052678
2
srcflib/email/__init__.py
mas90/srcf-python
0
9726
""" Notification email machinery, for tasks to send credentials and instructions to users. Email templates placed inside the `templates` directory of this module should: - extend from `layout` - provide `subject` and `body` blocks """ from enum import Enum import os.path from jinja2 import Environment, FileSystemLo...
""" Notification email machinery, for tasks to send credentials and instructions to users. Email templates placed inside the `templates` directory of this module should: - extend from `layout` - provide `subject` and `body` blocks """ from enum import Enum import os.path from jinja2 import Environment, FileSystemLo...
en
0.774941
Notification email machinery, for tasks to send credentials and instructions to users. Email templates placed inside the `templates` directory of this module should: - extend from `layout` - provide `subject` and `body` blocks Base layout template to be inherited by an email-specific template. Subject line of the ema...
2.538509
3
nose2_example/my_package/myapp.py
dolfandringa/PythonProjectStructureDemo
2
9727
from .operations import Multiply, Add, Substract class MyApp(object): def __init__(self): self.operations={'multiply': Multiply, 'add': Add, 'substract': Substract} def do(self, operation, number1, number2): return self.operations[operation.low...
from .operations import Multiply, Add, Substract class MyApp(object): def __init__(self): self.operations={'multiply': Multiply, 'add': Add, 'substract': Substract} def do(self, operation, number1, number2): return self.operations[operation.low...
none
1
3.253654
3
src/train_nn.py
anirudhbhashyam/911-Calls-Seattle-Predictions
0
9728
<gh_stars>0 import os from typing import Union import tensorflow as tf import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split, KFold import utility as ut from variables import * # Read the data. train_data = pd.read_csv(os.path.join(DATA_PATH, "....
import os from typing import Union import tensorflow as tf import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split, KFold import utility as ut from variables import * # Read the data. train_data = pd.read_csv(os.path.join(DATA_PATH, ".".join([DATA...
en
0.640894
# Read the data. # Get the labels. # -- For classification -- # # CLASSES = np.unique(Y) # N_CLASSES = len(CLASSES) # Y = Y.replace(dict(zip(CLASSES, range(0, len(CLASSES))))) # Data shape parameters. # Split the training data. Build and compile a TensorFLow LSTM network. Parameters ---------- input_ : Shape of...
3.119279
3
pdserver/objects.py
Gustavo6046/polydung
0
9729
<gh_stars>0 import base64 import random import string import netbyte import numpy as np try: import simplejson as json except ImportError: import json kinds = {} class PDObject(object): def __init__(self, game, kind, id, pos, properties): self.game = game self.kind = kind ...
import base64 import random import string import netbyte import numpy as np try: import simplejson as json except ImportError: import json kinds = {} class PDObject(object): def __init__(self, game, kind, id, pos, properties): self.game = game self.kind = kind self.id = ...
en
0.422646
# a shortcut for Netbyte # not only a shortcut for Netbyte
2.516005
3
football/football_test.py
EEdwardsA/DS-OOP-Review
0
9730
import unittest from players import Player, Quarterback from possible_values import * from game import Game from random import randint, uniform, sample from season import * # TODO - some things you can add... class FootballGameTest(unittest.TestCase): '''test the class''' def test_field_goal_made(self): ...
import unittest from players import Player, Quarterback from possible_values import * from game import Game from random import randint, uniform, sample from season import * # TODO - some things you can add... class FootballGameTest(unittest.TestCase): '''test the class''' def test_field_goal_made(self): ...
en
0.638937
# TODO - some things you can add... test the class Check the default values for Player and Quarterback yards=120, touchdowns=5, safety=1, interceptions=0
3.603117
4
preprocessor/base.py
shayanthrn/AGAIN-VC
3
9731
<reponame>shayanthrn/AGAIN-VC import os import logging import numpy as np from tqdm import tqdm from functools import partial from multiprocessing.pool import ThreadPool import pyworld as pw from util.dsp import Dsp logger = logging.getLogger(__name__) def preprocess_one(input_items, module, output_path=''): inp...
import os import logging import numpy as np from tqdm import tqdm from functools import partial from multiprocessing.pool import ThreadPool import pyworld as pw from util.dsp import Dsp logger = logging.getLogger(__name__) def preprocess_one(input_items, module, output_path=''): input_path, basename = input_item...
none
1
2.217593
2
divsum_stats.py
fjruizruano/SatIntExt
0
9732
<filename>divsum_stats.py<gh_stars>0 #!/usr/bin/python import sys from subprocess import call print "divsum_count.py ListOfDivsumFiles\n" try: files = sys.argv[1] except: files = raw_input("Introduce RepeatMasker's list of Divsum files with library size (tab separated): ") files = open(files).readlines() to...
<filename>divsum_stats.py<gh_stars>0 #!/usr/bin/python import sys from subprocess import call print "divsum_count.py ListOfDivsumFiles\n" try: files = sys.argv[1] except: files = raw_input("Introduce RepeatMasker's list of Divsum files with library size (tab separated): ") files = open(files).readlines() to...
ru
0.258958
#!/usr/bin/python
2.885818
3
agatecharts/charts/__init__.py
onyxfish/fever
4
9733
<gh_stars>1-10 #!/usr/bin/env python from agatecharts.charts.bars import Bars from agatecharts.charts.columns import Columns from agatecharts.charts.lines import Lines from agatecharts.charts.scatter import Scatter
#!/usr/bin/env python from agatecharts.charts.bars import Bars from agatecharts.charts.columns import Columns from agatecharts.charts.lines import Lines from agatecharts.charts.scatter import Scatter
ru
0.26433
#!/usr/bin/env python
1.308807
1
users/views.py
rossm6/accounts
11
9734
from django.contrib.auth import update_session_auth_hash from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.models import User from django.contrib.auth.views import (LoginView, PasswordResetConfirmView, PasswordResetView) from django.http import Htt...
from django.contrib.auth import update_session_auth_hash from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.models import User from django.contrib.auth.views import (LoginView, PasswordResetConfirmView, PasswordResetView) from django.http import Htt...
en
0.93328
# this will delete the current user session # and create anew
2.131227
2
test/core/s3_table_test_base.py
adidas/m3d-api
24
9735
<reponame>adidas/m3d-api<filename>test/core/s3_table_test_base.py import os from test.core.emr_system_unit_test_base import EMRSystemUnitTestBase from test.core.tconx_helper import TconxHelper class S3TableTestBase(EMRSystemUnitTestBase): default_tconx = \ "test/resources/s3_table_test_base/tconx-bdp-em...
import os from test.core.emr_system_unit_test_base import EMRSystemUnitTestBase from test.core.tconx_helper import TconxHelper class S3TableTestBase(EMRSystemUnitTestBase): default_tconx = \ "test/resources/s3_table_test_base/tconx-bdp-emr_test-dev-bi_test101.json" multi_partition_tconx = \ ...
en
0.624647
This function builds on top of EMRSystemUnitTestBase.env_setup() and adds test-specific tconx file. :param tmpdir: test case specific temporary directory where configuration files will be created. :param destination_system: destination system code :param destination_database: destination databa...
2.163591
2
metrics/serializers.py
BrianWaganerSTL/RocketDBaaS
1
9736
from rest_framework import serializers from metrics.models import Metrics_Cpu, Metrics_PingServer, Metrics_MountPoint, \ Metrics_CpuLoad, Metrics_PingDb class Metrics_CpuSerializer(serializers.ModelSerializer): class Meta: model = Metrics_Cpu fields = '__all__' depth = 0 class Metrics...
from rest_framework import serializers from metrics.models import Metrics_Cpu, Metrics_PingServer, Metrics_MountPoint, \ Metrics_CpuLoad, Metrics_PingDb class Metrics_CpuSerializer(serializers.ModelSerializer): class Meta: model = Metrics_Cpu fields = '__all__' depth = 0 class Metrics...
none
1
1.981495
2
sqlc/private/sqlc_toolchain.bzl
dmayle/rules_sqlc
2
9737
# Copyright 2020 Plezentek, Inc. 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 applicable law or...
# Copyright 2020 Plezentek, Inc. 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 applicable law or...
en
0.846447
# Copyright 2020 Plezentek, Inc. 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 applicable law or...
1.637326
2
configs/tracker_configs/new_test_20e_cam_1_new_short.py
nolanzzz/mtmct
17
9738
<reponame>nolanzzz/mtmct root = { "general" : { "display_viewer" : False, #The visible GPUS will be restricted to the numbers listed here. The pytorch (cuda:0) numeration will start at 0 #This is a trick to get everything onto the wanted gpus because just setting cuda:4 in the function cal...
root = { "general" : { "display_viewer" : False, #The visible GPUS will be restricted to the numbers listed here. The pytorch (cuda:0) numeration will start at 0 #This is a trick to get everything onto the wanted gpus because just setting cuda:4 in the function calls will #not work...
en
0.714727
#The visible GPUS will be restricted to the numbers listed here. The pytorch (cuda:0) numeration will start at 0 #This is a trick to get everything onto the wanted gpus because just setting cuda:4 in the function calls will #not work for mmdetection. There will still be things on gpu cuda:0. # To increase the speed whi...
1.892192
2
tests/structures/test_generator.py
cherub96/voc
1
9739
<reponame>cherub96/voc from ..utils import TranspileTestCase class GeneratorTests(TranspileTestCase): def test_simple_generator(self): self.assertCodeExecution(""" def multiplier(first, second): y = first * second yield y y *= second ...
from ..utils import TranspileTestCase class GeneratorTests(TranspileTestCase): def test_simple_generator(self): self.assertCodeExecution(""" def multiplier(first, second): y = first * second yield y y *= second yield y ...
en
0.49293
def multiplier(first, second): y = first * second yield y y *= second yield y y *= second yield y y *= second yield y print(list(multiplier(1, 20))) def fizz_buzz(start, stop): ...
3.192285
3
ogusa/tax.py
hdoupe/OG-USA
0
9740
<filename>ogusa/tax.py ''' ------------------------------------------------------------------------ Functions for taxes in the steady state and along the transition path. ------------------------------------------------------------------------ ''' # Packages import numpy as np from ogusa import utils ''' ------------...
<filename>ogusa/tax.py ''' ------------------------------------------------------------------------ Functions for taxes in the steady state and along the transition path. ------------------------------------------------------------------------ ''' # Packages import numpy as np from ogusa import utils ''' ------------...
en
0.70665
------------------------------------------------------------------------ Functions for taxes in the steady state and along the transition path. ------------------------------------------------------------------------ # Packages ------------------------------------------------------------------------ Functions -----...
2.587121
3
muse_for_anything/api/v1_api/taxonomy_items.py
baireutherjonas/muse-for-anything
0
9741
<filename>muse_for_anything/api/v1_api/taxonomy_items.py """Module containing the taxonomy items API endpoints of the v1 API.""" from datetime import datetime from sqlalchemy.sql.schema import Sequence from muse_for_anything.db.models.taxonomies import ( Taxonomy, TaxonomyItem, TaxonomyItemRelation, T...
<filename>muse_for_anything/api/v1_api/taxonomy_items.py """Module containing the taxonomy items API endpoints of the v1 API.""" from datetime import datetime from sqlalchemy.sql.schema import Sequence from muse_for_anything.db.models.taxonomies import ( Taxonomy, TaxonomyItem, TaxonomyItemRelation, T...
en
0.911726
Module containing the taxonomy items API endpoints of the v1 API. Endpoint for a single taxonomy item. # is not None because abort raises exception # cannot modify deleted namespace! # cannot modify deleted namespace! # cannot modify deleted taxonomy! Get a single taxonomy item. Update a taxonomy item. # restore action...
1.841306
2
PythonDAdata/3358OS_06_Code/code6/pd_plotting.py
shijiale0609/Python_Data_Analysis
1
9742
import matplotlib.pyplot as plt import numpy as np import pandas as pd df = pd.read_csv('transcount.csv') df = df.groupby('year').aggregate(np.mean) gpu = pd.read_csv('gpu_transcount.csv') gpu = gpu.groupby('year').aggregate(np.mean) df = pd.merge(df, gpu, how='outer', left_index=True, right_index=True) df = df.rep...
import matplotlib.pyplot as plt import numpy as np import pandas as pd df = pd.read_csv('transcount.csv') df = df.groupby('year').aggregate(np.mean) gpu = pd.read_csv('gpu_transcount.csv') gpu = gpu.groupby('year').aggregate(np.mean) df = pd.merge(df, gpu, how='outer', left_index=True, right_index=True) df = df.rep...
none
1
3.157782
3
source/blog/migrations/0004_postcomments.py
JakubGutowski/PersonalBlog
0
9743
<filename>source/blog/migrations/0004_postcomments.py # Generated by Django 2.0.5 on 2018-07-02 19:46 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('blog', '0003_blogpost_author'), ] operations = [ ...
<filename>source/blog/migrations/0004_postcomments.py # Generated by Django 2.0.5 on 2018-07-02 19:46 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('blog', '0003_blogpost_author'), ] operations = [ ...
en
0.666511
# Generated by Django 2.0.5 on 2018-07-02 19:46
1.517525
2
submissions/aising2019/a.py
m-star18/atcoder
1
9744
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10 ** 7) n = int(readline()) h = int(readline()) w = int(readline()) print((n - h + 1) * (n - w + 1))
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10 ** 7) n = int(readline()) h = int(readline()) w = int(readline()) print((n - h + 1) * (n - w + 1))
none
1
2.719723
3
CreateHalo.py
yoyoberenguer/MultiplayerGameEngine
4
9745
<filename>CreateHalo.py<gh_stars>1-10 import pygame from NetworkBroadcast import Broadcast, AnimatedSprite, DeleteSpriteCommand from Textures import HALO_SPRITE12, HALO_SPRITE14, HALO_SPRITE13 __author__ = "<NAME>" __credits__ = ["<NAME>"] __version__ = "1.0.0" __maintainer__ = "<NAME>" __email__ = "<EMAIL>"...
<filename>CreateHalo.py<gh_stars>1-10 import pygame from NetworkBroadcast import Broadcast, AnimatedSprite, DeleteSpriteCommand from Textures import HALO_SPRITE12, HALO_SPRITE14, HALO_SPRITE13 __author__ = "<NAME>" __credits__ = ["<NAME>"] __version__ = "1.0.0" __maintainer__ = "<NAME>" __email__ = "<EMAIL>"...
en
0.502474
Send a command to kill an object on client side. :return: DetectCollisionSprite object
2.362422
2
src/dataops/pandas_db.py
ShizhuZhang/ontask_b
0
9746
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function import logging import os.path import subprocess from collections import OrderedDict from itertools import izip import numpy as np import pandas as pd from django.conf import settings from django.core.cache import cache from django.db impo...
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function import logging import os.path import subprocess from collections import OrderedDict from itertools import izip import numpy as np import pandas as pd from django.conf import settings from django.core.cache import cache from django.db impo...
en
0.783379
# -*- coding: utf-8 -*- # Query to count the number of rows in a table # Translation between pandas data type names, and those handled in OnTask # Translation between SQL data type names, and those handled in OnTask # DB Engine to use with Pandas (required by to_sql, from_sql Function that creates the engine object to ...
2.315767
2
config/cf.py
rbsdev/config-client
0
9747
<gh_stars>0 from typing import Any, Dict, KeysView import attr from config.auth import OAuth2 from config.cfenv import CFenv from config.spring import ConfigClient @attr.s(slots=True) class CF: cfenv = attr.ib( type=CFenv, factory=CFenv, validator=attr.validators.instance_of(CFenv), ) oauth2 = a...
from typing import Any, Dict, KeysView import attr from config.auth import OAuth2 from config.cfenv import CFenv from config.spring import ConfigClient @attr.s(slots=True) class CF: cfenv = attr.ib( type=CFenv, factory=CFenv, validator=attr.validators.instance_of(CFenv), ) oauth2 = attr.ib(type=...
none
1
2.264096
2
ducktape/template.py
rancp/ducktape-docs
0
9748
<reponame>rancp/ducktape-docs # Copyright 2015 Confluent 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 ...
# Copyright 2015 Confluent 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, s...
en
0.742518
# Copyright 2015 Confluent 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, s...
2.244931
2
day4/homework/q7.py
AkshayManchanda/Python_Training
0
9749
<reponame>AkshayManchanda/Python_Training<gh_stars>0 i=input("Enter a string: ") list = i.split() list.sort() for i in list: print(i,end=' ')
i=input("Enter a string: ") list = i.split() list.sort() for i in list: print(i,end=' ')
none
1
3.976479
4
src/git_portfolio/use_cases/config_repos.py
staticdev/github-portfolio
0
9750
<filename>src/git_portfolio/use_cases/config_repos.py """Config repositories use case.""" from __future__ import annotations import git_portfolio.config_manager as cm import git_portfolio.domain.gh_connection_settings as cs import git_portfolio.responses as res class ConfigReposUseCase: """Gitp config repositori...
<filename>src/git_portfolio/use_cases/config_repos.py """Config repositories use case.""" from __future__ import annotations import git_portfolio.config_manager as cm import git_portfolio.domain.gh_connection_settings as cs import git_portfolio.responses as res class ConfigReposUseCase: """Gitp config repositori...
en
0.343925
Config repositories use case. Gitp config repositories use case. Initializer. Configuration of git repositories.
2.058089
2
test/test_logic.py
mateuszkowalke/sudoku_game
0
9751
import pytest from ..logic import Board, empty_board, example_board, solved_board class TestBoard: def test_create_board(self): board = Board(example_board) assert board.tiles == example_board def test_solve_board(self): board = Board(example_board) board.solve() asse...
import pytest from ..logic import Board, empty_board, example_board, solved_board class TestBoard: def test_create_board(self): board = Board(example_board) assert board.tiles == example_board def test_solve_board(self): board = Board(example_board) board.solve() asse...
none
1
3.072967
3
src/compas_rhino/objects/_select.py
jf---/compas
2
9752
from __future__ import print_function from __future__ import absolute_import from __future__ import division import ast import rhinoscriptsyntax as rs __all__ = [ 'mesh_select_vertex', 'mesh_select_vertices', 'mesh_select_face', 'mesh_select_faces', 'mesh_select_edge', 'mesh_select_edges', ...
from __future__ import print_function from __future__ import absolute_import from __future__ import division import ast import rhinoscriptsyntax as rs __all__ = [ 'mesh_select_vertex', 'mesh_select_vertices', 'mesh_select_face', 'mesh_select_faces', 'mesh_select_edge', 'mesh_select_edges', ...
en
0.300779
Select a single vertex of a mesh. Parameters ---------- mesh: :class:`compas.datastructures.Mesh` message: str, optional Returns ------- int or None Select multiple vertices of a mesh. Parameters ---------- mesh: :class:`compas.datastructures.Mesh` message: str, optional ...
2.3027
2
handlers/product_add.py
MuchkoM/CalorieMatchBot
0
9753
from telegram import Update from telegram.ext import Updater, CallbackContext, ConversationHandler, CommandHandler, MessageHandler, Filters from db import DBConnector import re str_matcher = r"\"(?P<name>.+)\"\s*(?P<fat>\d+)\s*/\s*(?P<protein>\d+)\s*/\s*(?P<carbohydrates>\d+)\s*(?P<kcal>\d+)" ADD_1 = 0 def add_0(...
from telegram import Update from telegram.ext import Updater, CallbackContext, ConversationHandler, CommandHandler, MessageHandler, Filters from db import DBConnector import re str_matcher = r"\"(?P<name>.+)\"\s*(?P<fat>\d+)\s*/\s*(?P<protein>\d+)\s*/\s*(?P<carbohydrates>\d+)\s*(?P<kcal>\d+)" ADD_1 = 0 def add_0(...
en
0.938881
/product_add - Add product to list known products
2.368037
2
python-packages/nolearn-0.5/build/lib.linux-x86_64-2.7/nolearn/tests/test_dataset.py
rajegannathan/grasp-lift-eeg-cat-dog-solution-updated
2
9754
<gh_stars>1-10 from mock import patch import numpy as np def test_dataset_simple(): from ..dataset import Dataset data = object() target = object() dataset = Dataset(data, target) assert dataset.data is data assert dataset.target is target @patch('nolearn.dataset.np.load') def test_dataset_...
from mock import patch import numpy as np def test_dataset_simple(): from ..dataset import Dataset data = object() target = object() dataset = Dataset(data, target) assert dataset.data is data assert dataset.target is target @patch('nolearn.dataset.np.load') def test_dataset_with_filenames(...
none
1
2.369039
2
src/Cipher/MultiLevelCaesarDecrypt.py
EpicTofuu/Assignment
0
9755
<reponame>EpicTofuu/Assignment import Cipher.tk from Cipher.tk import EncryptDecryptCoord, GetChiSquared, Mode def MultiDecrypt (message, alphabet, usables = 3, lan = "English", transformations = [], lowestchi = 9999, ogMessage = ""): msg = "" prev = (9999, (0, 0)) # (chi, key) for i ...
import Cipher.tk from Cipher.tk import EncryptDecryptCoord, GetChiSquared, Mode def MultiDecrypt (message, alphabet, usables = 3, lan = "English", transformations = [], lowestchi = 9999, ogMessage = ""): msg = "" prev = (9999, (0, 0)) # (chi, key) for i in range (len(message)): ...
en
0.620817
# (chi, key) # base case # only set lowest chi on the first run # testing do write it here a = " abcdefghijklmnopqrstuvwxyz" p=[] for c in a: p.append (c) print ("starting...") print (MultiDecrypt ("dtyktckcxlbd", p)) # original 231
3.471786
3
scripts/vcf_filter.py
bunop/cyvcf
46
9756
<reponame>bunop/cyvcf<gh_stars>10-100 #!/usr/bin/env python import sys import argparse import pkg_resources import vcf from vcf.parser import _Filter parser = argparse.ArgumentParser(description='Filter a VCF file', formatter_class=argparse.RawDescriptionHelpFormatter, ) parser.add_argument('input', m...
#!/usr/bin/env python import sys import argparse import pkg_resources import vcf from vcf.parser import _Filter parser = argparse.ArgumentParser(description='Filter a VCF file', formatter_class=argparse.RawDescriptionHelpFormatter, ) parser.add_argument('input', metavar='input', type=str, nargs=1, ...
en
0.585351
#!/usr/bin/env python # TODO: allow filter specification by short name # TODO: flag that writes filter output into INFO column # TODO: argument use implies filter use # TODO: parallelize # TODO: prevent plugins raising an exception from crashing the script # dynamically build the list of available filters # parse comma...
2.495073
2
src/flocker/blueprints/red/__init__.py
Muxelmann/home-projects
0
9757
import os from flask import Blueprint, render_template def create_bp(): bp_red = Blueprint('red', __name__, url_prefix='/red') @bp_red.route('/index/') @bp_red.route('/') def index(): return render_template('red/index.html') return bp_red
import os from flask import Blueprint, render_template def create_bp(): bp_red = Blueprint('red', __name__, url_prefix='/red') @bp_red.route('/index/') @bp_red.route('/') def index(): return render_template('red/index.html') return bp_red
none
1
2.296598
2
alphacoders/__init__.py
whoiscc/alphacoders
7
9758
<reponame>whoiscc/alphacoders # from aiohttp.client_exceptions import ClientError from lxml import html from pathlib import Path from asyncio import create_task from functools import wraps def start_immediately(task): @wraps(task) def wrapper(*args, **kwargs): return create_task(task(*args, **kwargs)...
# from aiohttp.client_exceptions import ClientError from lxml import html from pathlib import Path from asyncio import create_task from functools import wraps def start_immediately(task): @wraps(task) def wrapper(*args, **kwargs): return create_task(task(*args, **kwargs)) return wrapper @start...
en
0.573389
# # url = f"https://mobile.alphacoders.com/by-resolution/5?search={safe_keyword}&page={page}"
2.717837
3
Python/Calculating_Trimmed_Means/calculating_trimmed_means1.py
PeriscopeData/analytics-toolbox
2
9759
# SQL output is imported as a pandas dataframe variable called "df" # Source: https://stackoverflow.com/questions/19441730/trimmed-mean-with-percentage-limit-in-python import pandas as pd import matplotlib.pyplot as plt from scipy.stats import tmean, scoreatpercentile import numpy as np def trimmean(arr, percent): ...
# SQL output is imported as a pandas dataframe variable called "df" # Source: https://stackoverflow.com/questions/19441730/trimmed-mean-with-percentage-limit-in-python import pandas as pd import matplotlib.pyplot as plt from scipy.stats import tmean, scoreatpercentile import numpy as np def trimmean(arr, percent): ...
en
0.849478
# SQL output is imported as a pandas dataframe variable called "df" # Source: https://stackoverflow.com/questions/19441730/trimmed-mean-with-percentage-limit-in-python
3.285858
3
scripts/data_extract.py
amichalski2/WBC-SHAP
0
9760
import os import cv2 import random import numpy as np from tensorflow.keras.utils import to_categorical from scripts.consts import class_dict def get_data(path, split=0.2): X, y = [], [] for directory in os.listdir(path): dirpath = os.path.join(path, directory) print(directory, len(os.listd...
import os import cv2 import random import numpy as np from tensorflow.keras.utils import to_categorical from scripts.consts import class_dict def get_data(path, split=0.2): X, y = [], [] for directory in os.listdir(path): dirpath = os.path.join(path, directory) print(directory, len(os.listd...
none
1
2.634801
3
ironic/tests/unit/drivers/test_base.py
tzumainn/ironic
0
9761
<filename>ironic/tests/unit/drivers/test_base.py # Copyright 2014 Cisco Systems, Inc. # 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.ap...
<filename>ironic/tests/unit/drivers/test_base.py # Copyright 2014 Cisco Systems, Inc. # 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.ap...
en
0.865481
# Copyright 2014 Cisco Systems, Inc. # 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 requi...
2.069278
2
opentimesheet/profiles/tests/test_models.py
valerymelou/opentimesheet-server
0
9762
<reponame>valerymelou/opentimesheet-server import pytest from opentimesheet.core.tests import TenantTestCase @pytest.mark.usefixtures("profile") class TestProfile(TenantTestCase): def test__str__(self): assert ( self.profile.first_name + " " + self.profile.last_name == self.profil...
import pytest from opentimesheet.core.tests import TenantTestCase @pytest.mark.usefixtures("profile") class TestProfile(TenantTestCase): def test__str__(self): assert ( self.profile.first_name + " " + self.profile.last_name == self.profile.__str__() )
none
1
2.307724
2
ami/flowchart/library/Display.py
chuckie82/ami
6
9763
from ami.flowchart.library.DisplayWidgets import ScalarWidget, ScatterWidget, WaveformWidget, \ ImageWidget, ObjectWidget, LineWidget, TimeWidget, HistogramWidget, \ Histogram2DWidget from ami.flowchart.library.common import CtrlNode from amitypes import Array1d, Array2d from typing import Any import ami.graph_...
from ami.flowchart.library.DisplayWidgets import ScalarWidget, ScatterWidget, WaveformWidget, \ ImageWidget, ObjectWidget, LineWidget, TimeWidget, HistogramWidget, \ Histogram2DWidget from ami.flowchart.library.common import CtrlNode from amitypes import Array1d, Array2d from typing import Any import ami.graph_...
en
0.817348
ScalarViewer displays the value of a scalar. WaveformViewer displays 1D arrays. ImageViewer displays 2D arrays. ObjectViewer displays string representation of a python object. Histogram plots a histogram created from Binning. Histogram2D plots a 2d histogram created from Binning2D. Scatter Plot collects two scalars and...
2.432266
2
deep-rl/lib/python2.7/site-packages/OpenGL/GL/ARB/transform_feedback_instanced.py
ShujaKhalid/deep-rl
210
9764
<filename>deep-rl/lib/python2.7/site-packages/OpenGL/GL/ARB/transform_feedback_instanced.py<gh_stars>100-1000 '''OpenGL extension ARB.transform_feedback_instanced This module customises the behaviour of the OpenGL.raw.GL.ARB.transform_feedback_instanced to provide a more Python-friendly API Overview (from the spec)...
<filename>deep-rl/lib/python2.7/site-packages/OpenGL/GL/ARB/transform_feedback_instanced.py<gh_stars>100-1000 '''OpenGL extension ARB.transform_feedback_instanced This module customises the behaviour of the OpenGL.raw.GL.ARB.transform_feedback_instanced to provide a more Python-friendly API Overview (from the spec)...
en
0.770066
OpenGL extension ARB.transform_feedback_instanced This module customises the behaviour of the OpenGL.raw.GL.ARB.transform_feedback_instanced to provide a more Python-friendly API Overview (from the spec) Multiple instances of geometry may be specified to the GL by calling functions such as DrawArraysInstanced a...
1.723923
2
features/cpp/simple/test.py
xbabka01/retdec-regression-tests
8
9765
<filename>features/cpp/simple/test.py<gh_stars>1-10 from regression_tests import * class TestBase(Test): def test_for_main(self): assert self.out_c.has_funcs('main') or self.out_c.has_funcs('entry_point') def test_check_main_is_not_ctor_or_dtor(self): for c in self.out_config.classes: ...
<filename>features/cpp/simple/test.py<gh_stars>1-10 from regression_tests import * class TestBase(Test): def test_for_main(self): assert self.out_c.has_funcs('main') or self.out_c.has_funcs('entry_point') def test_check_main_is_not_ctor_or_dtor(self): for c in self.out_config.classes: ...
en
0.750024
# printf() is used -> '\n' at the end of the string # puts() is used -> no '\n' at the end of the string # there is some (!empty) function name
2.391305
2
src/experiment.py
windar427/find_alpha
0
9766
<filename>src/experiment.py from .lib.DownloadData import DownloadData
<filename>src/experiment.py from .lib.DownloadData import DownloadData
none
1
1.060894
1
src/__init__.py
songchenwen/icloud-drive-docker
0
9767
<filename>src/__init__.py __author__ = '<NAME> (<EMAIL>)' import warnings warnings.filterwarnings('ignore', category=DeprecationWarning)
<filename>src/__init__.py __author__ = '<NAME> (<EMAIL>)' import warnings warnings.filterwarnings('ignore', category=DeprecationWarning)
none
1
1.17847
1
test_basico.py
rafael-torraca/delivery
0
9768
<gh_stars>0 def test_one_plus_one_is_two(): assert 1 + 1 == 2 #o assert espera que algo seja verdadeiro, se for falso o teste quebrou def test_negative_1_plus_1_is_3(): assert 1 + 1 == 3
def test_one_plus_one_is_two(): assert 1 + 1 == 2 #o assert espera que algo seja verdadeiro, se for falso o teste quebrou def test_negative_1_plus_1_is_3(): assert 1 + 1 == 3
pt
0.680635
#o assert espera que algo seja verdadeiro, se for falso o teste quebrou
3.79914
4
setup.py
rohernandezz/coldtype
0
9769
import setuptools long_description = """ # Coldtype ### Programmatic display typography More info available at: [coldtype.goodhertz.com](https://coldtype.goodhertz.com) """ setuptools.setup( name="coldtype", version="0.6.6", author="<NAME> / Goodhertz", author_email="<EMAIL>", description="Funct...
import setuptools long_description = """ # Coldtype ### Programmatic display typography More info available at: [coldtype.goodhertz.com](https://coldtype.goodhertz.com) """ setuptools.setup( name="coldtype", version="0.6.6", author="<NAME> / Goodhertz", author_email="<EMAIL>", description="Funct...
en
0.569193
# Coldtype ### Programmatic display typography More info available at: [coldtype.goodhertz.com](https://coldtype.goodhertz.com) #package_dir={"": "coldtype"}, # can this be taken from skia-python? # https://github.com/gorakhargosh/watchdog/issues/702 # https://github.com/gorakhargosh/watchdog/issues/702
1.611154
2
GFOLD_problem.py
xdedss/SuccessiveConvexification
0
9770
# -*- coding: utf-8 -*- # GFOLD_static_p3p4 min_=min from cvxpy import * import cvxpy_codegen as cpg from time import time import numpy as np import sys import GFOLD_params ''' As defined in the paper... PROBLEM 3: Minimum Landing Error (tf roughly solved) MINIMIZE : norm of landing error vector SUBJ TO : ...
# -*- coding: utf-8 -*- # GFOLD_static_p3p4 min_=min from cvxpy import * import cvxpy_codegen as cpg from time import time import numpy as np import sys import GFOLD_params ''' As defined in the paper... PROBLEM 3: Minimum Landing Error (tf roughly solved) MINIMIZE : norm of landing error vector SUBJ TO : ...
en
0.737469
# -*- coding: utf-8 -*- # GFOLD_static_p3p4 As defined in the paper... PROBLEM 3: Minimum Landing Error (tf roughly solved) MINIMIZE : norm of landing error vector SUBJ TO : 0) initial conditions satisfied (position, velocity) 1) final conditions satisfied (altitude, velocity) 2...
2.57138
3
Hints.py
SarienFates/MMRandomizer
36
9771
import io import hashlib import logging import os import struct import random from HintList import getHint, getHintGroup, Hint from Utils import local_path #builds out general hints based on location and whether an item is required or not def buildGossipHints(world, rom): stoneAddresses = [0x938e4c, 0...
import io import hashlib import logging import os import struct import random from HintList import getHint, getHintGroup, Hint from Utils import local_path #builds out general hints based on location and whether an item is required or not def buildGossipHints(world, rom): stoneAddresses = [0x938e4c, 0...
en
0.915753
#builds out general hints based on location and whether an item is required or not #address for gossip stone text boxes, byte limit is 92 #These location will always have a hint somewhere in the world. #A random selection of these locations will be in the hint pool. #hopefully fixes weird VC error where the last charac...
2.440115
2
examen_2/p2/p2.py
Jhoselyn-Carballo/computacion_para_ingenieria
0
9772
# -*- coding: utf-8 -*- """ Created on Thu Feb 17 09:10:05 2022 @author: JHOSS """ from tkinter import * def contador(accion, contador): if accion == 'countUp': contador == contador + 1 elif accion == 'coundDown': contador == contador -1 elif accion == 'reset': contador == 0 return contador
# -*- coding: utf-8 -*- """ Created on Thu Feb 17 09:10:05 2022 @author: JHOSS """ from tkinter import * def contador(accion, contador): if accion == 'countUp': contador == contador + 1 elif accion == 'coundDown': contador == contador -1 elif accion == 'reset': contador == 0 return contador
en
0.736576
# -*- coding: utf-8 -*- Created on Thu Feb 17 09:10:05 2022 @author: JHOSS
3.373298
3
bokeh/models/tests/test_callbacks.py
ndepal/bokeh
1
9773
<reponame>ndepal/bokeh from pytest import raises from bokeh.models import CustomJS, Slider def test_js_callback(): slider = Slider() cb = CustomJS(code="foo();", args=dict(x=slider)) assert 'foo()' in cb.code assert cb.args['x'] is slider cb = CustomJS(code="foo();", args=dict(x=3)) assert '...
from pytest import raises from bokeh.models import CustomJS, Slider def test_js_callback(): slider = Slider() cb = CustomJS(code="foo();", args=dict(x=slider)) assert 'foo()' in cb.code assert cb.args['x'] is slider cb = CustomJS(code="foo();", args=dict(x=3)) assert 'foo()' in cb.code a...
en
0.353214
# kwargs not supported # fool pyflakes
2.172644
2
tests/test_0150-attributeerrors.py
martindurant/awkward-1.0
0
9774
# BSD 3-Clause License; see https://github.com/jpivarski/awkward-1.0/blob/master/LICENSE from __future__ import absolute_import import sys import pytest import numpy import awkward1 class Dummy(awkward1.Record): @property def broken(self): raise AttributeError("I'm broken!") def test(): behavi...
# BSD 3-Clause License; see https://github.com/jpivarski/awkward-1.0/blob/master/LICENSE from __future__ import absolute_import import sys import pytest import numpy import awkward1 class Dummy(awkward1.Record): @property def broken(self): raise AttributeError("I'm broken!") def test(): behavi...
en
0.783693
# BSD 3-Clause License; see https://github.com/jpivarski/awkward-1.0/blob/master/LICENSE # not "no field named 'broken'"
1.969888
2
scripts/preprocess.py
umd-lib/solr-irroc
0
9775
#!/user/bin/env python3 # -*- coding: utf8 -*- #===================================================# # cleanup.py # # <NAME> # # 2015-08-13 # # # # Dat...
#!/user/bin/env python3 # -*- coding: utf8 -*- #===================================================# # cleanup.py # # <NAME> # # 2015-08-13 # # # # Dat...
en
0.487706
#!/user/bin/env python3 # -*- coding: utf8 -*- #===================================================# # cleanup.py # # <NAME> # # 2015-08-13 # # # # Data ...
2.57541
3
ievv_opensource/demo/batchframeworkdemo/apps.py
appressoas/ievv_opensource
0
9776
from django.apps import AppConfig from ievv_opensource import ievv_batchframework from ievv_opensource.ievv_batchframework import batchregistry class HelloWorldAction(ievv_batchframework.Action): def execute(self): self.logger.info('Hello world! %r', self.kwargs) class HelloWorldAsyncAction(ievv_batchf...
from django.apps import AppConfig from ievv_opensource import ievv_batchframework from ievv_opensource.ievv_batchframework import batchregistry class HelloWorldAction(ievv_batchframework.Action): def execute(self): self.logger.info('Hello world! %r', self.kwargs) class HelloWorldAsyncAction(ievv_batchf...
none
1
2.009999
2
fmoe/gates/utils.py
GODVIX/fastmoe
0
9777
<filename>fmoe/gates/utils.py<gh_stars>0 r""" Utilities that may be used in the gates """ import torch from fmoe.functions import count_by_gate import fmoe_cuda as fmoe_native def limit_by_capacity(topk_idx, num_expert, world_size, capacity): capacity = torch.ones(num_expert, dtype=torch.int32, device...
<filename>fmoe/gates/utils.py<gh_stars>0 r""" Utilities that may be used in the gates """ import torch from fmoe.functions import count_by_gate import fmoe_cuda as fmoe_native def limit_by_capacity(topk_idx, num_expert, world_size, capacity): capacity = torch.ones(num_expert, dtype=torch.int32, device...
en
0.917752
Utilities that may be used in the gates
1.911596
2
evaluate.py
DeppMeng/DANNet
0
9778
<reponame>DeppMeng/DANNet<filename>evaluate.py import os import torch import numpy as np from PIL import Image import torch.nn as nn from torch.utils import data from network import * from dataset.zurich_night_dataset import zurich_night_DataSet from configs.test_config import get_arguments palette = [128, 64, 128,...
import os import torch import numpy as np from PIL import Image import torch.nn as nn from torch.utils import data from network import * from dataset.zurich_night_dataset import zurich_night_DataSet from configs.test_config import get_arguments palette = [128, 64, 128, 244, 35, 232, 70, 70, 70, 102, 102, 156, 190, ...
en
0.774967
###### get the enhanced image # change to BGR ###### get the light # change to BGR
2.293945
2
decorator.py
zengboming/python
0
9779
#decorator def now(): print "2015-11-18" f=now f() print now.__name__ print f.__name__ def log(func): def wrapper(*args,**kw): print 'begin call %s():' %func.__name__ func(*args,**kw) print 'end call %s():' %func.__name__ return wrapper @log def now1(): print now1.__name__ now1() now1=log(now1) now1() def...
#decorator def now(): print "2015-11-18" f=now f() print now.__name__ print f.__name__ def log(func): def wrapper(*args,**kw): print 'begin call %s():' %func.__name__ func(*args,**kw) print 'end call %s():' %func.__name__ return wrapper @log def now1(): print now1.__name__ now1() now1=log(now1) now1() def...
en
0.553214
#decorator
3.184262
3
test/pyfrechet_visualize.py
compgeomTU/frechetForCurves
0
9780
# Author: <NAME> # <EMAIL> # # Command line to run program: # python3 pyfrechet_visualize.py import sys, os, unittest sys.path.insert(0, "../") from pyfrechet.distance import StrongDistance from pyfrechet.visualize import FreeSpaceDiagram, Trajectories TEST_DATA = "sp500" if TEST_DATA == "sp500": REACHABLE_EPSIL...
# Author: <NAME> # <EMAIL> # # Command line to run program: # python3 pyfrechet_visualize.py import sys, os, unittest sys.path.insert(0, "../") from pyfrechet.distance import StrongDistance from pyfrechet.visualize import FreeSpaceDiagram, Trajectories TEST_DATA = "sp500" if TEST_DATA == "sp500": REACHABLE_EPSIL...
en
0.364627
# Author: <NAME> # <EMAIL> # # Command line to run program: # python3 pyfrechet_visualize.py
2.600627
3
py_ser_freeastro/core.py
nww2007/py_ser_freeastro
0
9781
#!/usr/bin/env python3 # vim:fileencoding=UTF-8 # -*- coding: UTF-8 -*- """ Created on 15 juny 2019 y. @author: <NAME> <EMAIL> """ import sys import struct import numpy as np from progress.bar import Bar import logging logging.basicConfig(format = u'%(filename)s:%(lineno)d: %(levelname)-8s [%(asctime)s] %(message)s...
#!/usr/bin/env python3 # vim:fileencoding=UTF-8 # -*- coding: UTF-8 -*- """ Created on 15 juny 2019 y. @author: <NAME> <EMAIL> """ import sys import struct import numpy as np from progress.bar import Bar import logging logging.basicConfig(format = u'%(filename)s:%(lineno)d: %(levelname)-8s [%(asctime)s] %(message)s...
en
0.318762
#!/usr/bin/env python3 # vim:fileencoding=UTF-8 # -*- coding: UTF-8 -*- Created on 15 juny 2019 y. @author: <NAME> <EMAIL> # class ser(np.array): A set of methods for working with a set of images in the SER format. Download information from file. # super.__init__() # luids # Download information from the heade...
2.571103
3
sgdml_dataset_generation/readers/fchk.py
humeniuka/sGDML_dataset_generation
0
9782
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- __all__ = ["FormattedCheckpointFile"] # # Imports import numpy as np import scipy.linalg as sla from collections import OrderedDict import re import logging # # Local Imports from sgdml_dataset_generation import units from sgdml_dataset_generation.units import...
#!/usr/bin/env python # -*- coding: utf-8 -*- __all__ = ["FormattedCheckpointFile"] # # Imports import numpy as np import scipy.linalg as sla from collections import OrderedDict import re import logging # # Local Imports from sgdml_dataset_generation import units from sgdml_dataset_generation.units import hbar # # L...
en
0.768298
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Imports # # Local Imports # # Logging reads all fields from formatted checkpoint files produced by the quantum chemistry programs Gaussian 16 and QChem. Parameters ---------- f : File file handle opened for reading a formatted checkpoint file...
2.94844
3
2020_01_01/max_values/max_values.py
94JuHo/Algorithm_study
0
9783
values = [] for i in range(9): values.append(int(input(''))) max_value = 0 location = 0 for i in range(9): if values[i] > max_value: max_value = values[i] location = i+1 print(max_value) print(location)
values = [] for i in range(9): values.append(int(input(''))) max_value = 0 location = 0 for i in range(9): if values[i] > max_value: max_value = values[i] location = i+1 print(max_value) print(location)
none
1
3.786208
4
fuzzywuzzy/process.py
rhasspy/fuzzywuzzy
3
9784
#!/usr/bin/env python # encoding: utf-8 """ process.py Copyright (c) 2011 <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 us...
#!/usr/bin/env python # encoding: utf-8 """ process.py Copyright (c) 2011 <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 us...
en
0.735952
#!/usr/bin/env python # encoding: utf-8 process.py Copyright (c) 2011 <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, c...
2.392474
2
day03/day03.py
robfalck/AoC2017
0
9785
<gh_stars>0 from __future__ import print_function, division, absolute_import import numpy as np INPUT = 265149 def part1(number): skip = 2 d = 1 row = None col = None for shell_idx in range(1, 10000): size = shell_idx * 2 + 1 a = d + skip b = a + skip c = b + ski...
from __future__ import print_function, division, absolute_import import numpy as np INPUT = 265149 def part1(number): skip = 2 d = 1 row = None col = None for shell_idx in range(1, 10000): size = shell_idx * 2 + 1 a = d + skip b = a + skip c = b + skip d ...
en
0.422821
# top # left # bottom # right A brute-force approach to part 2. # Determine if we need to change heading
2.724455
3
core/migrations/0004_auto_20210929_2354.py
codefair114/Inventory-App-Django
0
9786
<filename>core/migrations/0004_auto_20210929_2354.py # Generated by Django 3.2.7 on 2021-09-29 23:54 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('core', '0003_auto_20210929_2353'), ] operations = [ mi...
<filename>core/migrations/0004_auto_20210929_2354.py # Generated by Django 3.2.7 on 2021-09-29 23:54 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('core', '0003_auto_20210929_2353'), ] operations = [ mi...
en
0.823453
# Generated by Django 3.2.7 on 2021-09-29 23:54
1.38346
1
nova/api/openstack/compute/legacy_v2/contrib/console_auth_tokens.py
bopopescu/nova-token
0
9787
begin_unit comment|'# Copyright 2013 Cloudbase Solutions Srl' nl|'\n' comment|'# All Rights Reserved.' nl|'\n' comment|'#' nl|'\n' comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may' nl|'\n' comment|'# not use this file except in compliance with the License. You may obtain' nl|'\n'...
begin_unit comment|'# Copyright 2013 Cloudbase Solutions Srl' nl|'\n' comment|'# All Rights Reserved.' nl|'\n' comment|'#' nl|'\n' comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may' nl|'\n' comment|'# not use this file except in compliance with the License. You may obtain' nl|'\n'...
en
0.53614
Checks a console auth token and returns the related connect info. Console token authentication support.
1.236482
1
ahrs/common/geometry.py
jaluebbe/ahrs
184
9788
<filename>ahrs/common/geometry.py # -*- coding: utf-8 -*- """ Geometrical functions --------------------- References ---------- .. [W1] Wikipedia: https://de.wikipedia.org/wiki/Ellipse#Ellipsengleichung_(Parameterform) .. [WAE] Wolfram Alpha: Ellipse. (http://mathworld.wolfram.com/Ellipse.html) """ import numpy as n...
<filename>ahrs/common/geometry.py # -*- coding: utf-8 -*- """ Geometrical functions --------------------- References ---------- .. [W1] Wikipedia: https://de.wikipedia.org/wiki/Ellipse#Ellipsengleichung_(Parameterform) .. [WAE] Wolfram Alpha: Ellipse. (http://mathworld.wolfram.com/Ellipse.html) """ import numpy as n...
en
0.52084
# -*- coding: utf-8 -*- Geometrical functions --------------------- References ---------- .. [W1] Wikipedia: https://de.wikipedia.org/wiki/Ellipse#Ellipsengleichung_(Parameterform) .. [WAE] Wolfram Alpha: Ellipse. (http://mathworld.wolfram.com/Ellipse.html) Build a circle with the given characteristics. Parameter...
3.937743
4
htdocs/plotting/auto/scripts100/p116.py
jamayfieldjr/iem
1
9789
"""Monthly HDD/CDD Totals.""" import datetime from pandas.io.sql import read_sql from pyiem.plot.use_agg import plt from pyiem.util import get_dbconn, get_autoplot_context from pyiem.exceptions import NoDataFound PDICT = {'cdd': 'Cooling Degree Days', 'hdd': 'Heating Degree Days'} def get_description(): ...
"""Monthly HDD/CDD Totals.""" import datetime from pandas.io.sql import read_sql from pyiem.plot.use_agg import plt from pyiem.util import get_dbconn, get_autoplot_context from pyiem.exceptions import NoDataFound PDICT = {'cdd': 'Cooling Degree Days', 'hdd': 'Heating Degree Days'} def get_description(): ...
en
0.787647
Monthly HDD/CDD Totals. Return a dict describing how to call this plotter This chart presents monthly cooling degree days or heating degree days for a 20 year period of your choice. The 20 year limit is for plot usability only, the data download has all available years contained. Go SELECT year, month, sum...
2.888843
3
examples/horovod/ray_torch_shuffle.py
krfricke/ray_shuffling_data_loader
16
9790
import os import pickle import time import timeit import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import numpy as np import torch import tempfile import horovod.torch as hvd from horovod.ray import RayExecutor from ray_shuffling_data_loader.torch_dataset import (TorchShufflingDatase...
import os import pickle import time import timeit import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import numpy as np import torch import tempfile import horovod.torch as hvd from horovod.ray import RayExecutor from ray_shuffling_data_loader.torch_dataset import (TorchShufflingDatase...
en
0.656283
# Training settings # Synthetic training data generation settings. # Shuffling data loader settings. # Horovod: initialize library. # Horovod: pin GPU to local rank. # Horovod: limit # of CPU threads to be used per worker. # By default, Adasum doesn"t need scaling up learning rate. # Move model to GPU. # If using GPU A...
2.270872
2
tests/test_main/test_base/tests.py
PitonX60/django-firebird
51
9791
<reponame>PitonX60/django-firebird # -*- coding: utf-8 -*- from datetime import datetime, timedelta from django.conf import settings from django.db import connection, DatabaseError from django.db.models import F, DateField, DateTimeField, IntegerField, TimeField, CASCADE from django.db.models.fields.related import Fo...
# -*- coding: utf-8 -*- from datetime import datetime, timedelta from django.conf import settings from django.db import connection, DatabaseError from django.db.models import F, DateField, DateTimeField, IntegerField, TimeField, CASCADE from django.db.models.fields.related import ForeignKey from django.db.models.func...
en
0.75436
# -*- coding: utf-8 -*- # Convert to target timezone before truncation # otherwise, truncate to year # If there was a daylight saving transition, then reset the timezone. FirebirdSQL already creates indexes automatically for foreign keys. (#70). # Just return indexes others that not automaically created by Fk Make sure...
2.096732
2
tests/test_past_failures.py
justinbois/eqtk
2
9792
import pytest import numpy as np import eqtk def test_promiscuous_binding_failure(): A = np.array( [ [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, ...
import pytest import numpy as np import eqtk def test_promiscuous_binding_failure(): A = np.array( [ [ 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, ...
none
1
1.945195
2
sdk/python/pulumi_azure/lb/outbound_rule.py
suresh198526/pulumi-azure
0
9793
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** 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, Mapping, Optional, Sequence, Union from .. import _utilitie...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** 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, Mapping, Optional, Sequence, Union from .. import _utilitie...
en
0.640442
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** Manages a Load Balancer Outbound Rule. > **NOTE** When using this resource, the Load Balancer needs to have a FrontEnd IP Confi...
1.544875
2
orbit_predictor/predictors/base.py
Juanlu001/orbit-predictor
0
9794
<gh_stars>0 # MIT License # # Copyright (c) 2017 <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, ...
# MIT License # # Copyright (c) 2017 <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, publi...
en
0.799172
# MIT License # # Copyright (c) 2017 <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, publi...
1.711189
2
vilmedic/scorers/NLG/__init__.py
jbdel/vilmedic
15
9795
<reponame>jbdel/vilmedic from .rouge import ROUGEScorer from .bleu.bleu import BLEUScorer from .meteor.meteor import METEORScorer from .cider.cider import Cider from .ciderd.ciderd import CiderD
from .rouge import ROUGEScorer from .bleu.bleu import BLEUScorer from .meteor.meteor import METEORScorer from .cider.cider import Cider from .ciderd.ciderd import CiderD
none
1
0.973505
1
tests/test_liif.py
Yshuo-Li/mmediting-test
2
9796
import numpy as np import torch import torch.nn as nn from mmcv.runner import obj_from_dict from mmcv.utils.config import Config from mmedit.models import build_model from mmedit.models.losses import L1Loss from mmedit.models.registry import COMPONENTS @COMPONENTS.register_module() class BP(nn.Module): """A simp...
import numpy as np import torch import torch.nn as nn from mmcv.runner import obj_from_dict from mmcv.utils.config import Config from mmedit.models import build_model from mmedit.models.losses import L1Loss from mmedit.models.registry import COMPONENTS @COMPONENTS.register_module() class BP(nn.Module): """A simp...
en
0.508143
A simple BP network for testing LIIF. Args: in_dim (int): Input dimension. out_dim (int): Output dimension. # build restorer # test attributes # prepare data # prepare optimizer # test train_step and forward_test (cpu) # test train_step and forward_test (gpu) # train_step # val_step
2.107408
2
database/signals.py
ccraddock/beiwe-backend-cc
0
9797
<gh_stars>0 from django.utils import timezone from django.core.exceptions import ObjectDoesNotExist from django.db.models.signals import post_save, pre_save from django.dispatch import receiver from database.study_models import DeviceSettings, Study, Survey, SurveyArchive @receiver(post_save, sender=Study)...
from django.utils import timezone from django.core.exceptions import ObjectDoesNotExist from django.db.models.signals import post_save, pre_save from django.dispatch import receiver from database.study_models import DeviceSettings, Study, Survey, SurveyArchive @receiver(post_save, sender=Study) def populate...
en
0.915589
Ensure that every newly created Study object has a DeviceSettings object. This essentially makes the OneToOneField have null=False in both directions. # If my_study has just been created and doesn't have a DeviceSettings # attached to it, create one with the default parameters. Ensure that every time a Survey is e...
2.296067
2
docs/examples/notify/notify_skeleton.py
Blakstar26/npyscreen
0
9798
import npyscreen class NotifyBaseExample(npyscreen.Form): def create(self): key_of_choice = 'p' what_to_display = 'Press {} for popup \n Press escape key to quit'.format(key_of_choice) self.how_exited_handers[npyscreen.wgwidget.EXITED_ESCAPE] = self.exit_application self.add(npysc...
import npyscreen class NotifyBaseExample(npyscreen.Form): def create(self): key_of_choice = 'p' what_to_display = 'Press {} for popup \n Press escape key to quit'.format(key_of_choice) self.how_exited_handers[npyscreen.wgwidget.EXITED_ESCAPE] = self.exit_application self.add(npysc...
none
1
2.371183
2
practicioner_bundle/ch15-neural_style/pyimagesearch/nn/conv/minigooglenet.py
romanroson/pis_code
1
9799
# -*- coding: utf-8 -*- """Implementation of MiniGoogLeNet architecture. This implementation is based on the original implemetation of GoogLeNet. The authors of the net used BN before Activation layer. This should be switched. """ from keras.layers.normalization import BatchNormalization from keras.layers.convolutiona...
# -*- coding: utf-8 -*- """Implementation of MiniGoogLeNet architecture. This implementation is based on the original implemetation of GoogLeNet. The authors of the net used BN before Activation layer. This should be switched. """ from keras.layers.normalization import BatchNormalization from keras.layers.convolutiona...
en
0.613197
# -*- coding: utf-8 -*- Implementation of MiniGoogLeNet architecture. This implementation is based on the original implemetation of GoogLeNet. The authors of the net used BN before Activation layer. This should be switched. Implementation of MiniGoogLeNet architecture Define conv layer Arguments: ...
3.501246
4