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
hermetrics/damerau_levenshtein.py
SoldAI/hermetrics
3
7600
<filename>hermetrics/damerau_levenshtein.py from .levenshtein import Levenshtein class DamerauLevenshtein(Levenshtein): def __init__(self, name='Damerau-Levenshtein'): super().__init__(name=name) def distance(self, source, target, cost=(1, 1, 1, 1)): """Damerau-Levenshtein distance with c...
<filename>hermetrics/damerau_levenshtein.py from .levenshtein import Levenshtein class DamerauLevenshtein(Levenshtein): def __init__(self, name='Damerau-Levenshtein'): super().__init__(name=name) def distance(self, source, target, cost=(1, 1, 1, 1)): """Damerau-Levenshtein distance with c...
en
0.805677
Damerau-Levenshtein distance with costs for deletion, insertion, substitution and transposition # Be sure to exceed maximum value #INF = float('inf') # Initialize matrix (s_len + 2) X (t_len + 2) # Holds last row each element was encountered # Current symbol in source # Column of lasta match on this row # Current symbo...
3.395736
3
etna/analysis/outliers/hist_outliers.py
Carlosbogo/etna
1
7601
<reponame>Carlosbogo/etna import typing from copy import deepcopy from typing import TYPE_CHECKING from typing import List import numba import numpy as np import pandas as pd if TYPE_CHECKING: from etna.datasets import TSDataset @numba.jit(nopython=True) def optimal_sse(left: int, right: int, p: np.ndarray, pp:...
import typing from copy import deepcopy from typing import TYPE_CHECKING from typing import List import numba import numpy as np import pandas as pd if TYPE_CHECKING: from etna.datasets import TSDataset @numba.jit(nopython=True) def optimal_sse(left: int, right: int, p: np.ndarray, pp: np.ndarray) -> float: ...
en
0.663076
Count the approximation error by 1 bin from left to right elements. Parameters ---------- left: left border right: right border p: array of sums of elements, p[i] - sum from first to i elements pp: array of sums of squares of elements, p[i] - sum of squares from ...
2.72692
3
aws/securityGroup.py
emanueleleyland/sabd-project2
0
7602
def createKafkaSecurityGroup(ec2, vpc): sec_group_kafka = ec2.create_security_group( GroupName='kafka', Description='kafka sec group', VpcId=vpc.id) sec_group_kafka.authorize_ingress( IpPermissions=[{'IpProtocol': 'icmp', 'FromPort': -1, 'ToPort': -1, 'IpRanges': [{'CidrIp': '0.0.0.0/0'}]}, ...
def createKafkaSecurityGroup(ec2, vpc): sec_group_kafka = ec2.create_security_group( GroupName='kafka', Description='kafka sec group', VpcId=vpc.id) sec_group_kafka.authorize_ingress( IpPermissions=[{'IpProtocol': 'icmp', 'FromPort': -1, 'ToPort': -1, 'IpRanges': [{'CidrIp': '0.0.0.0/0'}]}, ...
none
1
1.997952
2
virtual/lib/python3.6/site-packages/django_pusher/context_processors.py
petermirithu/hooby_lab
2
7603
<gh_stars>1-10 from django.conf import settings def pusher(request): return { "PUSHER_KEY": getattr(settings, "PUSHER_KEY", ""), }
from django.conf import settings def pusher(request): return { "PUSHER_KEY": getattr(settings, "PUSHER_KEY", ""), }
none
1
1.595303
2
inconnu/character/update/parse.py
tiltowait/inconnu
4
7604
<reponame>tiltowait/inconnu """character/update/parse.py - Defines an interface for updating character traits.""" # pylint: disable=too-many-arguments import re import discord from discord_ui.components import LinkButton from . import paramupdate from ..display import display from ... import common, constants from ....
"""character/update/parse.py - Defines an interface for updating character traits.""" # pylint: disable=too-many-arguments import re import discord from discord_ui.components import LinkButton from . import paramupdate from ..display import display from ... import common, constants from ...log import Log from ...vch...
en
0.751347
character/update/parse.py - Defines an interface for updating character traits. # pylint: disable=too-many-arguments #/character-tracking?id=tracker-updates" Process the user's arguments. Allow the user to omit a character if they have only one. # Some people think colons work ... # Stop the sh+3 madness # Let +/-=...
2.677846
3
src/models/train_search_multi_deep.py
smadha/MlTrio
0
7605
''' Uses flattened features in feature directory and run a SVM on it ''' from keras.layers import Dense from keras.models import Sequential import keras.regularizers as Reg from keras.optimizers import SGD, RMSprop from keras.callbacks import EarlyStopping import cPickle as pickle import numpy as np from sklearn.model...
''' Uses flattened features in feature directory and run a SVM on it ''' from keras.layers import Dense from keras.models import Sequential import keras.regularizers as Reg from keras.optimizers import SGD, RMSprop from keras.callbacks import EarlyStopping import cPickle as pickle import numpy as np from sklearn.model...
en
0.655489
Uses flattened features in feature directory and run a SVM on it Normalize training and test data features Args: X_tr: Unnormalized training features Output: X_tr: Normalized training features Generate a neural network model of approporiate architecture Args: num_units: architecture ...
2.91148
3
formation.py
graham-kim/pygremlin-graph-visualiser
0
7606
<filename>formation.py import sys import os sys.path.append( os.path.dirname(__file__) ) import numpy as np import typing as tp import angles from model import Node, Link, Label from spec import ArrowDraw, NodeSpec class FormationManager: def __init__(self): self._nodes = {} self._links = [] ...
<filename>formation.py import sys import os sys.path.append( os.path.dirname(__file__) ) import numpy as np import typing as tp import angles from model import Node, Link, Label from spec import ArrowDraw, NodeSpec class FormationManager: def __init__(self): self._nodes = {} self._links = [] ...
en
0.943289
# i is already the previous index
2.646873
3
opencv_camera/parameters/utils.py
MomsFriendlyRobotCompany/opencv_camera
6
7607
############################################## # The MIT License (MIT) # Copyright (c) 2014 <NAME> # see LICENSE for full details ############################################## # -*- coding: utf-8 -* from math import atan, pi def fov(w,f): """ Returns the FOV as in degrees, given: w: image...
############################################## # The MIT License (MIT) # Copyright (c) 2014 <NAME> # see LICENSE for full details ############################################## # -*- coding: utf-8 -* from math import atan, pi def fov(w,f): """ Returns the FOV as in degrees, given: w: image...
en
0.363945
############################################## # The MIT License (MIT) # Copyright (c) 2014 <NAME> # see LICENSE for full details ############################################## # -*- coding: utf-8 -* Returns the FOV as in degrees, given: w: image width (or height) in pixels f: focalLength (fx or...
2.796296
3
Code_Hybrid_SLIMBPR_CBF_RP3Beta.py
SamanFekri/BookRecommendation
0
7608
# This Python 3 environment comes with many helpful analytics libraries installed # It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g...
# This Python 3 environment comes with many helpful analytics libraries installed # It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g...
en
0.72643
# This Python 3 environment comes with many helpful analytics libraries installed # It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python # For example, here's several helpful packages to load # linear algebra # data processing, CSV file I/O (e.g. pd.read_csv) ##### URM #not needed #n...
2.333224
2
dodge/config.py
MoyTW/7DRL2016_Rewrite
2
7609
<gh_stars>1-10 import json class Config(object): def __init__(self, file_location): with open(file_location, 'r') as f: config = json.load(f) self.SCREEN_WIDTH = int(config["SCREEN_WIDTH"]) self.SCREEN_HEIGHT = int(config["SCREEN_HEIGHT"]) self.MAP_WIDTH = i...
import json class Config(object): def __init__(self, file_location): with open(file_location, 'r') as f: config = json.load(f) self.SCREEN_WIDTH = int(config["SCREEN_WIDTH"]) self.SCREEN_HEIGHT = int(config["SCREEN_HEIGHT"]) self.MAP_WIDTH = int(config["MAP_...
en
0.508681
# Derived values # etc etc etc
2.793381
3
incal_lib/create_dataframe.py
barel-mishal/InCal_lib
0
7610
<reponame>barel-mishal/InCal_lib import pandas as pd import numpy as np def create_calr_example_df(n_rows, start_date): ''' ''' np.random.seed(20) array = np.random.rand(n_rows) cumulative = np.cumsum(array) d = { 'feature1_subject_1': array, 'feature1_subject_2': array, ...
import pandas as pd import numpy as np def create_calr_example_df(n_rows, start_date): ''' ''' np.random.seed(20) array = np.random.rand(n_rows) cumulative = np.cumsum(array) d = { 'feature1_subject_1': array, 'feature1_subject_2': array, 'feature2_subject_1': cumulati...
none
1
2.985364
3
HybridSN/DataLoadAndOperate.py
lms-07/HybridSN
0
7611
import os import numpy as np import scipy.io as sio import tifffile from sklearn.decomposition import PCA from sklearn.model_selection import train_test_split #Load dataset def loadData(name,data_path): if name == 'IP': data = sio.loadmat(os.path.join(data_path, 'Indian_pines_corrected.mat'))['indian_pin...
import os import numpy as np import scipy.io as sio import tifffile from sklearn.decomposition import PCA from sklearn.model_selection import train_test_split #Load dataset def loadData(name,data_path): if name == 'IP': data = sio.loadmat(os.path.join(data_path, 'Indian_pines_corrected.mat'))['indian_pin...
en
0.44998
#Load dataset # dict_keys(['__header__', '__version__', '__globals__', 'Houston']) #dict_values([b'MATLAB 5.0 MAT-file, Platform: PCWIN64, Created on: Wed Jul 17 16:45:01 2019', '1.0', [], array()]) #data = sio.loadmat(os.path.join(data_path, 'Houston.mat')) #labels = sio.loadmat(os.path.join(data_path,'Houston_gt.mat'...
2.486353
2
alipay/aop/api/domain/AlipayOpenIotmbsDooropenresultSyncModel.py
antopen/alipay-sdk-python-all
0
7612
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class AlipayOpenIotmbsDooropenresultSyncModel(object): def __init__(self): self._dev_id = None self._door_state = None self._project_id = None @property def dev_id(self...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class AlipayOpenIotmbsDooropenresultSyncModel(object): def __init__(self): self._dev_id = None self._door_state = None self._project_id = None @property def dev_id(self...
en
0.352855
#!/usr/bin/env python # -*- coding: utf-8 -*-
1.989218
2
setup.py
ghost58400/marlin-binary-protocol
0
7613
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="marlin_binary_protocol", version="0.0.7", author="<NAME>", author_email="<EMAIL>", description="Transfer files with Marlin 2.0 firmware using Marlin Binary Protocol Mark II", long_desc...
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="marlin_binary_protocol", version="0.0.7", author="<NAME>", author_email="<EMAIL>", description="Transfer files with Marlin 2.0 firmware using Marlin Binary Protocol Mark II", long_desc...
none
1
1.418212
1
taut_euler_class.py
henryseg/Veering
2
7614
<reponame>henryseg/Veering # # taut_euler_class.py # from file_io import parse_data_file, write_data_file from taut import liberal, isosig_to_tri_angle from transverse_taut import is_transverse_taut from sage.matrix.constructor import Matrix from sage.modules.free_module_element import vector from sage.arith.misc im...
# # taut_euler_class.py # from file_io import parse_data_file, write_data_file from taut import liberal, isosig_to_tri_angle from transverse_taut import is_transverse_taut from sage.matrix.constructor import Matrix from sage.modules.free_module_element import vector from sage.arith.misc import gcd from sage.arith.fu...
en
0.881353
# # taut_euler_class.py # # # Goal - given a transverse taut triangulation, decide if the # associated "absolute" euler class is torsion or not. If it is # torsion, determine its order. # # Contents and overview: # 1. References. # # 2. Background. # # 3. Helper functions. # # 4. Truncate. We build the correct "trunc...
2.214289
2
mailing/urls.py
ananyamalik/Railway-Concession-Portal
0
7615
<filename>mailing/urls.py from django.urls import path from .views import ( student_list, student_add, student_profile,student_delete )
<filename>mailing/urls.py from django.urls import path from .views import ( student_list, student_add, student_profile,student_delete )
none
1
1.518483
2
transformers/tests/tokenization_xlnet_test.py
deepbluesea/transformers
270
7616
# coding=utf-8 # Copyright 2018 The Google AI Language Team 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 ...
# coding=utf-8 # Copyright 2018 The Google AI Language Team 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 ...
en
0.853889
# coding=utf-8 # Copyright 2018 The Google AI Language Team 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 ...
2.256918
2
preprocess/utils/liftOver_vcf.py
Rongtingting/xcltk
0
7617
# forked from https://github.com/single-cell-genetics/cellSNP ## A python wrap of UCSC liftOver function for vcf file ## UCSC liftOver binary and hg19 to hg38 chain file: ## https://genome.ucsc.edu/cgi-bin/hgLiftOver ## http://hgdownload.cse.ucsc.edu/admin/exe/linux.x86_64/liftOver ## http://hgdownload.soe.ucsc.edu/gol...
# forked from https://github.com/single-cell-genetics/cellSNP ## A python wrap of UCSC liftOver function for vcf file ## UCSC liftOver binary and hg19 to hg38 chain file: ## https://genome.ucsc.edu/cgi-bin/hgLiftOver ## http://hgdownload.cse.ucsc.edu/admin/exe/linux.x86_64/liftOver ## http://hgdownload.soe.ucsc.edu/gol...
en
0.579815
# forked from https://github.com/single-cell-genetics/cellSNP ## A python wrap of UCSC liftOver function for vcf file ## UCSC liftOver binary and hg19 to hg38 chain file: ## https://genome.ucsc.edu/cgi-bin/hgLiftOver ## http://hgdownload.cse.ucsc.edu/admin/exe/linux.x86_64/liftOver ## http://hgdownload.soe.ucsc.edu/gol...
2.365941
2
pomodorr/frames/tests/test_consumers.py
kamil559/pomodorr
0
7618
<filename>pomodorr/frames/tests/test_consumers.py import json import pytest from channels.db import database_sync_to_async from channels.testing import WebsocketCommunicator from pytest_lazyfixture import lazy_fixture from pomodorr.frames import statuses from pomodorr.frames.models import DateFrame from pomodorr.fram...
<filename>pomodorr/frames/tests/test_consumers.py import json import pytest from channels.db import database_sync_to_async from channels.testing import WebsocketCommunicator from pytest_lazyfixture import lazy_fixture from pomodorr.frames import statuses from pomodorr.frames.models import DateFrame from pomodorr.fram...
en
0.916656
# check if pomodoro hasn't been stopped by starting a pause date frame # pause should be finished here # Only now the pomodoro is expected to be finished
2.082868
2
Bot/db_aps.py
FaHoLo/Fish_shop
0
7619
import logging import os import redis import moltin_aps _database = None db_logger = logging.getLogger('db_logger') async def get_database_connection(): global _database if _database is None: database_password = os.getenv('DB_PASSWORD') database_host = os.getenv('DB_HOST') databas...
import logging import os import redis import moltin_aps _database = None db_logger = logging.getLogger('db_logger') async def get_database_connection(): global _database if _database is None: database_password = os.getenv('DB_PASSWORD') database_host = os.getenv('DB_HOST') databas...
none
1
2.170927
2
backend/server/tables/__init__.py
shiv12095/realtimeviz
1
7620
from .lime_bike_feed import LimeBikeFeed from .lime_bike_trips import LimeBikeTrips from .lime_bike_trips_analyze import LimeBikeTripsAnalyze
from .lime_bike_feed import LimeBikeFeed from .lime_bike_trips import LimeBikeTrips from .lime_bike_trips_analyze import LimeBikeTripsAnalyze
none
1
1.040724
1
sapmon/payload/provider/sapnetweaver.py
gummadirajesh/AzureMonitorForSAPSolutions
0
7621
# Python modules import json import logging from datetime import datetime, timedelta, timezone from time import time from typing import Any, Callable import re import requests from requests import Session from threading import Lock # SOAP Client modules from zeep import Client from zeep import helpers from zeep.transp...
# Python modules import json import logging from datetime import datetime, timedelta, timezone from time import time from typing import Any, Callable import re import requests from requests import Session from threading import Lock # SOAP Client modules from zeep import Client from zeep import helpers from zeep.transp...
en
0.864491
# Python modules # SOAP Client modules # Payload modules # Suppress SSLError warning due to missing SAP server certificate # wait time in between attempts to re-download and install RFC SDK package if we have a download blob # URL defined and previous install attempt was not successful # timeout to use for all SOAP WSD...
1.723837
2
docker_squash/version.py
pombredanne/docker-scripts
513
7622
<reponame>pombredanne/docker-scripts version = "1.0.10.dev0"
version = "1.0.10.dev0"
none
1
1.133893
1
example_usage/example_list_errors.py
oceanprotocol/plecos
1
7623
from pathlib import Path import plecos import json print(plecos.__version__) #%% path_to_json_local = Path("~/ocn/plecos/plecos/samples/sample_metadata_local.json").expanduser() path_to_json_remote = Path("~/ocn/plecos/plecos/samples/sample_metadata_remote.json").expanduser() path_to_broken_json = Path("~/ocn/plecos/pl...
from pathlib import Path import plecos import json print(plecos.__version__) #%% path_to_json_local = Path("~/ocn/plecos/plecos/samples/sample_metadata_local.json").expanduser() path_to_json_remote = Path("~/ocn/plecos/plecos/samples/sample_metadata_remote.json").expanduser() path_to_broken_json = Path("~/ocn/plecos/pl...
en
0.27759
#%% # Select remote or local metadata #%% # del json_dict['base']['files'][0]['url'] # json_dict['base']['extra'] = 1 # json_dict['base']['files'][0]['url'] # json_dict['base']['EXTRA ATTRIB!'] = 0 # json_dict['base']['files'][0]['EXTRA_ATTR'] = "????" # json_dict['base']['price'] = "A string is not allowed!" #%% #%%
2.221911
2
pangloss/backend.py
CLRafaelR/pangloss
0
7624
<gh_stars>0 import re import panflute as pf from functools import partial from pangloss.util import smallcapify, break_plain # regular expression for label formats label_re = re.compile(r'\{#ex:(\w+)\}') gb4e_fmt_labelled = """ \\ex\\label{{ex:{label}}} \\gll {} \\\\ {} \\\\ \\trans {} """ gb4e_fmt = """ \\ex \\gl...
import re import panflute as pf from functools import partial from pangloss.util import smallcapify, break_plain # regular expression for label formats label_re = re.compile(r'\{#ex:(\w+)\}') gb4e_fmt_labelled = """ \\ex\\label{{ex:{label}}} \\gll {} \\\\ {} \\\\ \\trans {} """ gb4e_fmt = """ \\ex \\gll {} \\\\ {}...
en
0.687521
# regular expression for label formats #ex:(\w+)\}') \\ex\\label{{ex:{label}}} \\gll {} \\\\ {} \\\\ \\trans {} \\ex \\gll {} \\\\ {} \\\\ \\trans {} Convert an example list into a series of gb4e-formatted interlinear glosses. Because example list references are replaced at parsing by Pandoc, the normal sy...
2.61622
3
tests/unit/discovery/test_py_spec.py
xavfernandez/virtualenv
1
7625
from __future__ import absolute_import, unicode_literals import itertools import os import sys from copy import copy import pytest from virtualenv.discovery.py_spec import PythonSpec def test_bad_py_spec(): text = "python2.3.4.5" spec = PythonSpec.from_string_spec(text) assert text in repr(spec) as...
from __future__ import absolute_import, unicode_literals import itertools import os import sys from copy import copy import pytest from virtualenv.discovery.py_spec import PythonSpec def test_bad_py_spec(): text = "python2.3.4.5" spec = PythonSpec.from_string_spec(text) assert text in repr(spec) as...
en
0.952971
# can be satisfied in both directions
2.174502
2
plugins/module_utils/definitions/trigger_image_activation.py
robertcsapo/dnacenter-ansible
0
7626
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json module_definition = json.loads( """{ "family": "software_image_management_swim", "name": "trigger_image_activation", "operations": { "post": [ "trigger_software_image_activation" ...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json module_definition = json.loads( """{ "family": "software_image_management_swim", "name": "trigger_image_activation", "operations": { "post": [ "trigger_software_image_activation" ...
en
0.248682
{ "family": "software_image_management_swim", "name": "trigger_image_activation", "operations": { "post": [ "trigger_software_image_activation" ] }, "parameters": { "trigger_software_image_activation": [ { "name": "schedule_validate", ...
2.088445
2
minecraft_launcher_lib/fabric.py
bopchik/Simple-minecraft-mod-launcher
1
7627
<filename>minecraft_launcher_lib/fabric.py from .helper import download_file, get_user_agent from .install import install_minecraft_version from typing import List, Dict, Union from xml.dom import minidom import subprocess import requests import tempfile import random import os def get_all_minecraft_versions() -> List...
<filename>minecraft_launcher_lib/fabric.py from .helper import download_file, get_user_agent from .install import install_minecraft_version from typing import List, Dict, Union from xml.dom import minidom import subprocess import requests import tempfile import random import os def get_all_minecraft_versions() -> List...
en
0.770355
Returns all available Minecraft Versions for fabric Returns a list which only contains the stable Minecraft versions that supports fabric Returns the latest unstable Minecraft versions that supports fabric. This could be a snapshot. Returns the latest stable Minecraft version that supports fabric Checks if a Minecraft ...
2.698596
3
Strand Sort.py
Nishkarsh-Tripathi/Sorting-algorithms-
5
7628
# STRAND SORT # It is a recursive comparison based sorting technique which sorts in increasing order. # It works by repeatedly pulling sorted sub-lists out of the list to be sorted and merging them # with a result array. # Algorithm: # Create a empty strand (list) and append the first element to it popping it from th...
# STRAND SORT # It is a recursive comparison based sorting technique which sorts in increasing order. # It works by repeatedly pulling sorted sub-lists out of the list to be sorted and merging them # with a result array. # Algorithm: # Create a empty strand (list) and append the first element to it popping it from th...
en
0.792996
# STRAND SORT # It is a recursive comparison based sorting technique which sorts in increasing order. # It works by repeatedly pulling sorted sub-lists out of the list to be sorted and merging them # with a result array. # Algorithm: # Create a empty strand (list) and append the first element to it popping it from the ...
4.44916
4
gamestonk_terminal/cryptocurrency/overview/pycoingecko_model.py
minhhoang1023/GamestonkTerminal
0
7629
"""CoinGecko model""" __docformat__ = "numpy" # pylint: disable=C0301, E1101 import logging import re from typing import Any, List import numpy as np import pandas as pd from pycoingecko import CoinGeckoAPI from gamestonk_terminal.cryptocurrency.dataframe_helpers import ( create_df_index, long_number_format...
"""CoinGecko model""" __docformat__ = "numpy" # pylint: disable=C0301, E1101 import logging import re from typing import Any, List import numpy as np import pandas as pd from pycoingecko import CoinGeckoAPI from gamestonk_terminal.cryptocurrency.dataframe_helpers import ( create_df_index, long_number_format...
en
0.589894
CoinGecko model # pylint: disable=C0301, E1101 Returns public companies that holds ethereum or bitcoin [Source: CoinGecko] Parameters ---------- endpoint : str "bitcoin" or "ethereum" Returns ------- List: - str: Overall statistics - pandas.DataFrame: Compa...
2.133292
2
docker/messein/board-import-app/app.py
sourceperl/tk-dashboard
0
7630
<filename>docker/messein/board-import-app/app.py #!/usr/bin/env python3 from configparser import ConfigParser from datetime import datetime import urllib.parse import hashlib import io import json import logging import os import re import time from xml.dom import minidom import feedparser import requests import schedu...
<filename>docker/messein/board-import-app/app.py #!/usr/bin/env python3 from configparser import ConfigParser from datetime import datetime import urllib.parse import hashlib import io import json import logging import os import re import time from xml.dom import minidom import feedparser import requests import schedu...
en
0.542574
#!/usr/bin/env python3 # some const # some var # read config # redis # redis-loos for share # gmap img traffic # gsheet # openweathermap # webdav # some class # create connector # some function # https request # check error # decode json message # populate zones dict with receive values # load record data # retain toda...
1.72463
2
fsleyes_widgets/widgetlist.py
pauldmccarthy/fsleyes-widgets
1
7631
<filename>fsleyes_widgets/widgetlist.py #!/usr/bin/env python # # widgetlist.py - A widget which displays a list of groupable widgets. # # Author: <NAME> <<EMAIL>> # """This module provides the :class:`WidgetList` class, which displays a list of widgets. """ import wx import wx.lib.newevent as wxevent import wx....
<filename>fsleyes_widgets/widgetlist.py #!/usr/bin/env python # # widgetlist.py - A widget which displays a list of groupable widgets. # # Author: <NAME> <<EMAIL>> # """This module provides the :class:`WidgetList` class, which displays a list of widgets. """ import wx import wx.lib.newevent as wxevent import wx....
en
0.781098
#!/usr/bin/env python # # widgetlist.py - A widget which displays a list of groupable widgets. # # Author: <NAME> <<EMAIL>> # This module provides the :class:`WidgetList` class, which displays a list of widgets. A scrollable list of widgets. The ``WidgetList`` provides a number of features: - Widgets can be...
3.104602
3
setup.py
TransactPRO/gw3-python-client
1
7632
#!/usr/bin/env python import setuptools MAINTAINER_NAME = '<NAME>' MAINTAINER_EMAIL = '<EMAIL>' URL_GIT = 'https://github.com/TransactPRO/gw3-python-client' try: import pypandoc LONG_DESCRIPTION = pypandoc.convert('README.md', 'rst') except (IOError, ImportError, OSError, RuntimeError): LONG_DESCRIPTION...
#!/usr/bin/env python import setuptools MAINTAINER_NAME = '<NAME>' MAINTAINER_EMAIL = '<EMAIL>' URL_GIT = 'https://github.com/TransactPRO/gw3-python-client' try: import pypandoc LONG_DESCRIPTION = pypandoc.convert('README.md', 'rst') except (IOError, ImportError, OSError, RuntimeError): LONG_DESCRIPTION...
ru
0.26433
#!/usr/bin/env python
1.323531
1
social_auth_mitxpro/backends_test.py
mitodl/social-auth-mitxpro
0
7633
<filename>social_auth_mitxpro/backends_test.py """Tests for our backend""" from urllib.parse import urljoin import pytest from social_auth_mitxpro.backends import MITxProOAuth2 # pylint: disable=redefined-outer-name @pytest.fixture def strategy(mocker): """Mock strategy""" return mocker.Mock() @pytest.f...
<filename>social_auth_mitxpro/backends_test.py """Tests for our backend""" from urllib.parse import urljoin import pytest from social_auth_mitxpro.backends import MITxProOAuth2 # pylint: disable=redefined-outer-name @pytest.fixture def strategy(mocker): """Mock strategy""" return mocker.Mock() @pytest.f...
en
0.588228
Tests for our backend # pylint: disable=redefined-outer-name Mock strategy MITxProOAuth2 backend fixture Test that get_user_details produces expected results Tests that the backend makes a correct appropriate request # pylint: disable=unused-argument Dummy setting func Test authorization_url() Test access_token_url()
2.413482
2
Scripts/simulation/careers/detective/detective_crime_scene.py
velocist/TS4CheatsInfo
0
7634
# uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Server\careers\detective\detective_crime_scene.py # Compiled at: 2015-02-08 03:00:54 # Size of source mod 2...
# uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Server\careers\detective\detective_crime_scene.py # Compiled at: 2015-02-08 03:00:54 # Size of source mod 2...
en
0.517288
# uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Server\careers\detective\detective_crime_scene.py # Compiled at: 2015-02-08 03:00:54 # Size of source mod 2...
1.94666
2
classifier/interpretation_exp.py
methylgrammarlab/proj_scwgbs
0
7635
<reponame>methylgrammarlab/proj_scwgbs """ Code adapted from https://github.com/ohlerlab/DeepRiPe with changes Extract information and graphs from the Integrated gradients output """ import argparse import os import sys import matplotlib.pyplot as plt import numpy as np import seaborn as sns from classifier.plotseql...
""" Code adapted from https://github.com/ohlerlab/DeepRiPe with changes Extract information and graphs from the Integrated gradients output """ import argparse import os import sys import matplotlib.pyplot as plt import numpy as np import seaborn as sns from classifier.plotseqlogo import seqlogo_fig from commons imp...
en
0.862805
Code adapted from https://github.com/ohlerlab/DeepRiPe with changes Extract information and graphs from the Integrated gradients output Plot the multiple sequences in one figure :param sequences_dict: A dictionary with pl or cl as key and the integrated values results for each sequence in this label :param ...
2.687476
3
scripts/pythonutils/autorepr.py
shulinye/dotfiles
2
7636
<reponame>shulinye/dotfiles<filename>scripts/pythonutils/autorepr.py #!/usr/bin/python3 from collections import OrderedDict from functools import partial from ordered_set import OrderedSet import inspect import itertools import types from .utils import walk_getattr __all__ = ['autoinit', 'autorepr', 'TotalCompareByK...
#!/usr/bin/python3 from collections import OrderedDict from functools import partial from ordered_set import OrderedSet import inspect import itertools import types from .utils import walk_getattr __all__ = ['autoinit', 'autorepr', 'TotalCompareByKey'] def autoinit(obj=None, *args, params=None, **kwargs): """T...
en
0.814307
#!/usr/bin/python3 Takes __slots__ and _slots and writes an __init__ Can be used as a class decorator, or by setting __init__ = autoinit #I'm being used as a decorator Function that automagically gives you a __repr__. If no params are given, uses __slots__, _slots, and at last resort, inspects __in...
2.584168
3
v1.0.0.test/toontown/estate/DistributedGardenPlotAI.py
TTOFFLINE-LEAK/ttoffline
4
7637
<filename>v1.0.0.test/toontown/estate/DistributedGardenPlotAI.py<gh_stars>1-10 from direct.directnotify import DirectNotifyGlobal from toontown.estate import GardenGlobals from toontown.estate.DistributedLawnDecorAI import DistributedLawnDecorAI FLOWER_X_OFFSETS = ( None, (0, ), (-1.5, 1.5), (-3.4, 0, 3.5)) class Dis...
<filename>v1.0.0.test/toontown/estate/DistributedGardenPlotAI.py<gh_stars>1-10 from direct.directnotify import DirectNotifyGlobal from toontown.estate import GardenGlobals from toontown.estate.DistributedLawnDecorAI import DistributedLawnDecorAI FLOWER_X_OFFSETS = ( None, (0, ), (-1.5, 1.5), (-3.4, 0, 3.5)) class Dis...
none
1
2.159944
2
python/handwritten_baseline/pipeline/model/feature_extr/debug.py
UKPLab/cdcr-beyond-corpus-tailored
10
7638
import pprint from typing import Optional, List, Tuple, Set, Dict import numpy as np from overrides import overrides from python.handwritten_baseline.pipeline.data.base import Dataset from python.handwritten_baseline.pipeline.model.feature_extr import DEBUG_EXTR from python.handwritten_baseline.pipeline.model.feature...
import pprint from typing import Optional, List, Tuple, Set, Dict import numpy as np from overrides import overrides from python.handwritten_baseline.pipeline.data.base import Dataset from python.handwritten_baseline.pipeline.model.feature_extr import DEBUG_EXTR from python.handwritten_baseline.pipeline.model.feature...
en
0.612206
Returns constant or random feature value for testing purposes.
2.331641
2
kunquat/tracker/errorbase.py
cyberixae/kunquat
0
7639
# -*- coding: utf-8 -*- # # Author: <NAME>, Finland 2014 # # This file is part of Kunquat. # # CC0 1.0 Universal, http://creativecommons.org/publicdomain/zero/1.0/ # # To the extent possible under law, Kunquat Affirmers have waived all # copyright and related or neighboring rights to Kunquat. # from __future__ import...
# -*- coding: utf-8 -*- # # Author: <NAME>, Finland 2014 # # This file is part of Kunquat. # # CC0 1.0 Universal, http://creativecommons.org/publicdomain/zero/1.0/ # # To the extent possible under law, Kunquat Affirmers have waived all # copyright and related or neighboring rights to Kunquat. # from __future__ import...
en
0.8139
# -*- coding: utf-8 -*- # # Author: <NAME>, Finland 2014 # # This file is part of Kunquat. # # CC0 1.0 Universal, http://creativecommons.org/publicdomain/zero/1.0/ # # To the extent possible under law, Kunquat Affirmers have waived all # copyright and related or neighboring rights to Kunquat. # Please submit an issue t...
1.928511
2
venv/lib/python3.5/site-packages/igraph/test/atlas.py
dtklinh/Protein-Rigid-Domains-Estimation
2
7640
<reponame>dtklinh/Protein-Rigid-Domains-Estimation import warnings import unittest from igraph import * class TestBase(unittest.TestCase): def testPageRank(self): for idx, g in enumerate(self.__class__.graphs): try: pr = g.pagerank() except Exception as ex: ...
import warnings import unittest from igraph import * class TestBase(unittest.TestCase): def testPageRank(self): for idx, g in enumerate(self.__class__.graphs): try: pr = g.pagerank() except Exception as ex: self.assertTrue(False, msg="PageRank calcula...
en
0.148066
#%d: %s" % (idx, ex)) #%d (%r)" % (idx, pr)) #%d (%r)" % (idx, pr)) # Temporarily turn off the warning handler because g.evcent() will print # a warning for DAGs #%d: %s" % (idx, ex)) # Skip disconnected graphs; this will be fixed in igraph 0.7 #%d" % idx) #%d" % idx) #%d (%r)" % \ #%d" % idx) #%d seems to be invalid "...
2.834119
3
pycspr/types/cl.py
momipsl/pycspr
2
7641
import dataclasses import enum class CLType(enum.Enum): """Enumeration over set of CL types. """ BOOL = 0 I32 = 1 I64 = 2 U8 = 3 U32 = 4 U64 = 5 U128 = 6 U256 = 7 U512 = 8 UNIT = 9 STRING = 10 KEY = 11 UREF = 12 OPTION = 13 LIST = 14 BYTE_A...
import dataclasses import enum class CLType(enum.Enum): """Enumeration over set of CL types. """ BOOL = 0 I32 = 1 I64 = 2 U8 = 3 U32 = 4 U64 = 5 U128 = 6 U256 = 7 U512 = 8 UNIT = 9 STRING = 10 KEY = 11 UREF = 12 OPTION = 13 LIST = 14 BYTE_A...
en
0.6857
Enumeration over set of CL types. # Set of types considered to be simple. Encapsulates CL type information associated with a value. # Associated type within CSPR type system. Returns a tag used when encoding/decoding. Encapsulates CL type information associated with a byte array value. # Size of associated byte array v...
2.787342
3
google/cloud/aiplatform_v1/types/env_var.py
nachocano/python-aiplatform
0
7642
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
en
0.731116
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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.925861
2
tools/borplay/packlib.py
MrCoolSpan/openbor
25
7643
<filename>tools/borplay/packlib.py<gh_stars>10-100 # Copyright (c) 2009 <NAME> ("Plombo") # Class and functions to read .PAK files. import struct from cStringIO import StringIO class PackFileReader(object): ''' Represents a BOR packfile. ''' files = dict() # the index holding the location of each file ...
<filename>tools/borplay/packlib.py<gh_stars>10-100 # Copyright (c) 2009 <NAME> ("Plombo") # Class and functions to read .PAK files. import struct from cStringIO import StringIO class PackFileReader(object): ''' Represents a BOR packfile. ''' files = dict() # the index holding the location of each file ...
en
0.849537
# Copyright (c) 2009 <NAME> ("Plombo") # Class and functions to read .PAK files. Represents a BOR packfile. # the index holding the location of each file # the file object fp is a file path (string) or file-like object (file, StringIO, etc.) in binary read mode # reads the packfile's index into self.files # read th...
2.967646
3
artascope/src/web/app.py
magus0219/icloud-photo-downloader
3
7644
<filename>artascope/src/web/app.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Created by magus0219[<EMAIL>] on 2020/3/23 from types import FunctionType from flask import ( Flask, redirect, url_for, ) import artascope.src.web.lib.filter as module_filter from artascope.src.web.lib.content_processor im...
<filename>artascope/src/web/app.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Created by magus0219[<EMAIL>] on 2020/3/23 from types import FunctionType from flask import ( Flask, redirect, url_for, ) import artascope.src.web.lib.filter as module_filter from artascope.src.web.lib.content_processor im...
en
0.599839
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Created by magus0219[<EMAIL>] on 2020/3/23 # create and configure the app # register blueprint # register index # register context processor
1.712298
2
tests/common/test_op/scatter_nd.py
KnowingNothing/akg-test
1
7645
<filename>tests/common/test_op/scatter_nd.py # Copyright 2019 Huawei Technologies Co., Ltd # # 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 # # U...
<filename>tests/common/test_op/scatter_nd.py # Copyright 2019 Huawei Technologies Co., Ltd # # 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 # # U...
en
0.777584
# Copyright 2019 Huawei Technologies Co., Ltd # # 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...
2.271925
2
spc/backend_utils.py
adamnew123456/spc
1
7646
""" Utility functions and classes shared by multiple backends """ from collections import namedtuple import logging from . import symbols from . import types LOGGER = logging.getLogger('spc.backend_utils') # NameContexts encapsulate both the function stack (which holds values) and # the symbol table context (which b...
""" Utility functions and classes shared by multiple backends """ from collections import namedtuple import logging from . import symbols from . import types LOGGER = logging.getLogger('spc.backend_utils') # NameContexts encapsulate both the function stack (which holds values) and # the symbol table context (which b...
en
0.839775
Utility functions and classes shared by multiple backends # NameContexts encapsulate both the function stack (which holds values) and # the symbol table context (which binds them) # While loops are identified by two labels - the start label, for re-running # the condition, and the end label, for exiting when the condit...
2.563542
3
heareval/__init__.py
neuralaudio/hear-eval-kit
24
7647
__version__ = "2021.0.6"
__version__ = "2021.0.6"
none
1
1.050445
1
recommender_engine/similarity_measure/__init__.py
tranlyvu/recommender
8
7648
""" recommender_engine ----- recommender_engine is a recommendation application using either item-based or user-based approaches :copyright: (c) 2016 - 2019 by <NAME>. All Rights Reserved. :license: Apache License 2.0 """ from .cosine import cosine from .euclidean_distance import euclidean_distance from .pears...
""" recommender_engine ----- recommender_engine is a recommendation application using either item-based or user-based approaches :copyright: (c) 2016 - 2019 by <NAME>. All Rights Reserved. :license: Apache License 2.0 """ from .cosine import cosine from .euclidean_distance import euclidean_distance from .pears...
en
0.804016
recommender_engine ----- recommender_engine is a recommendation application using either item-based or user-based approaches :copyright: (c) 2016 - 2019 by <NAME>. All Rights Reserved. :license: Apache License 2.0
1.584651
2
code/abc057_a_02.py
KoyanagiHitoshi/AtCoder
3
7649
a,b=map(int,input().split()) print((a+b)%24)
a,b=map(int,input().split()) print((a+b)%24)
none
1
2.3394
2
8/8_9.py
kopsh/python_cookbook
0
7650
<filename>8/8_9.py class CheckType: r""" 8.9 创建新的类或实例属性 使用描述器,实现参数类型检查 >>> @ParamAssert(a=int, b=list) ... class A: ... def __init__(self, a, b): ... self.a = a ... self.b = b >>> a = A(1, []) """ def __init__(self, name, expected_type): self.name...
<filename>8/8_9.py class CheckType: r""" 8.9 创建新的类或实例属性 使用描述器,实现参数类型检查 >>> @ParamAssert(a=int, b=list) ... class A: ... def __init__(self, a, b): ... self.a = a ... self.b = b >>> a = A(1, []) """ def __init__(self, name, expected_type): self.name...
en
0.358631
8.9 创建新的类或实例属性 使用描述器,实现参数类型检查 >>> @ParamAssert(a=int, b=list) ... class A: ... def __init__(self, a, b): ... self.a = a ... self.b = b >>> a = A(1, []) >>> p = Point(0, 0) >>> print(p.x) 0 >>> p.y = "1" Traceback (most recent call last): ... TypeE...
3.358447
3
test/examples/test_simple_gp_regression.py
ediphy-dwild/gpytorch
0
7651
import math import torch import unittest import gpytorch from torch import optim from torch.autograd import Variable from gpytorch.kernels import RBFKernel from gpytorch.means import ConstantMean from gpytorch.likelihoods import GaussianLikelihood from gpytorch.random_variables import GaussianRandomVariable # Simple ...
import math import torch import unittest import gpytorch from torch import optim from torch.autograd import Variable from gpytorch.kernels import RBFKernel from gpytorch.means import ConstantMean from gpytorch.likelihoods import GaussianLikelihood from gpytorch.random_variables import GaussianRandomVariable # Simple ...
en
0.856111
# Simple training data: let's try to learn a sine function # We're manually going to set the hyperparameters to be ridiculous # Update bounds to accommodate extreme parameters # Update parameters # Compute posterior distribution # Let's see how our model does, conditioned with weird hyperparams # The posterior should f...
2.572127
3
samples/RiskManagement/Verification/customer-match-denied-parties-list.py
snavinch/cybersource-rest-samples-python
21
7652
from CyberSource import * import os import json from importlib.machinery import SourceFileLoader config_file = os.path.join(os.getcwd(), "data", "Configuration.py") configuration = SourceFileLoader("module.name", config_file).load_module() # To delete None values in Input Request Json body def del_none(d): for ke...
from CyberSource import * import os import json from importlib.machinery import SourceFileLoader config_file = os.path.join(os.getcwd(), "data", "Configuration.py") configuration = SourceFileLoader("module.name", config_file).load_module() # To delete None values in Input Request Json body def del_none(d): for ke...
en
0.751425
# To delete None values in Input Request Json body
2.423543
2
SimulatePi.py
Lucchese-Anthony/MonteCarloSimulation
0
7653
<filename>SimulatePi.py import numpy as np import random import math import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib import style angle = np.linspace( 0 , 2 * np.pi , 150) radius = 1 x = radius * np.cos(angle) y = radius * np.sin(angle) #prints the circle style.use('fivet...
<filename>SimulatePi.py import numpy as np import random import math import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib import style angle = np.linspace( 0 , 2 * np.pi , 150) radius = 1 x = radius * np.cos(angle) y = radius * np.sin(angle) #prints the circle style.use('fivet...
en
0.210097
#prints the circle
3.729666
4
run.py
aarvanitii/adminWebsite
0
7654
""" This is where the web application starts running """ from app.index import create_app app = create_app() if __name__ == "__main__": app.secret_key = 'mysecret' app.run(port=8080, host="0.0.0.0", debug=True)
""" This is where the web application starts running """ from app.index import create_app app = create_app() if __name__ == "__main__": app.secret_key = 'mysecret' app.run(port=8080, host="0.0.0.0", debug=True)
en
0.879538
This is where the web application starts running
1.94348
2
tareas/3/GarciaFigueroaAlberto-GarciaEdgar/Proceso.py
jorgelmp/sistop-2022-1
6
7655
class Proceso: def __init__(self,tiempo_de_llegada,t,id): self.t=t self.tiempo_de_llegada=tiempo_de_llegada self.id=id self.inicio=0 self.fin=0 self.T=0 self.E=0 self.P=0 self.tRestantes = t
class Proceso: def __init__(self,tiempo_de_llegada,t,id): self.t=t self.tiempo_de_llegada=tiempo_de_llegada self.id=id self.inicio=0 self.fin=0 self.T=0 self.E=0 self.P=0 self.tRestantes = t
none
1
2.755216
3
Algo and DSA/LeetCode-Solutions-master/Python/smallest-greater-multiple-made-of-two-digits.py
Sourav692/FAANG-Interview-Preparation
3,269
7656
# Time: sum(O(l * 2^l) for l in range(1, 11)) = O(20 * 2^10) = O(1) # Space: O(1) class Solution(object): def findInteger(self, k, digit1, digit2): """ :type k: int :type digit1: int :type digit2: int :rtype: int """ MAX_NUM_OF_DIGITS = 10 INT_MAX = ...
# Time: sum(O(l * 2^l) for l in range(1, 11)) = O(20 * 2^10) = O(1) # Space: O(1) class Solution(object): def findInteger(self, k, digit1, digit2): """ :type k: int :type digit1: int :type digit2: int :rtype: int """ MAX_NUM_OF_DIGITS = 10 INT_MAX = ...
en
0.426329
# Time: sum(O(l * 2^l) for l in range(1, 11)) = O(20 * 2^10) = O(1) # Space: O(1) :type k: int :type digit1: int :type digit2: int :rtype: int
3.223471
3
aldryn_people/tests/test_plugins.py
compoundpartners/js-people
0
7657
# -*- coding: utf-8 -*- from __future__ import unicode_literals try: from django.core.urlresolvers import reverse except ImportError: # Django 2.0 from django.urls import reverse from django.utils.translation import force_text from cms import api from cms.utils.i18n import force_language from aldryn_peop...
# -*- coding: utf-8 -*- from __future__ import unicode_literals try: from django.core.urlresolvers import reverse except ImportError: # Django 2.0 from django.urls import reverse from django.utils.translation import force_text from cms import api from cms.utils.i18n import force_language from aldryn_peop...
en
0.654985
# -*- coding: utf-8 -*- # Django 2.0 We add a person to the People Plugin and look her up # This fails because of Sane Add Plugin (I suspect). This will be refactored # and re-enabled in a future commit. # def test_add_people_list_plugin_client(self): # """ # We log into the PeoplePlugin # """ # self.cl...
2.320902
2
turbo_transformers/python/tests/__init__.py
xcnick/TurboTransformers
1,147
7658
<gh_stars>1000+ # Copyright (C) 2020 THL A29 Limited, a Tencent company. # All rights reserved. # Licensed under the BSD 3-Clause License (the "License"); you may # not use this file except in compliance with the License. You may # obtain a copy of the License at # https://opensource.org/licenses/BSD-3-Clause # Unless ...
# Copyright (C) 2020 THL A29 Limited, a Tencent company. # All rights reserved. # Licensed under the BSD 3-Clause License (the "License"); you may # not use this file except in compliance with the License. You may # obtain a copy of the License at # https://opensource.org/licenses/BSD-3-Clause # Unless required by appl...
en
0.874476
# Copyright (C) 2020 THL A29 Limited, a Tencent company. # All rights reserved. # Licensed under the BSD 3-Clause License (the "License"); you may # not use this file except in compliance with the License. You may # obtain a copy of the License at # https://opensource.org/licenses/BSD-3-Clause # Unless required by appl...
0.795338
1
generate_joke.py
audreymychan/djsmile
5
7659
# This script contains the get_joke() function to generate a new dad joke import requests def get_joke(): """Return new joke string from icanhazdadjoke.com.""" url = "https://icanhazdadjoke.com/" response = requests.get(url, headers={'Accept': 'application/json'}) raw_joke = response.json() joke ...
# This script contains the get_joke() function to generate a new dad joke import requests def get_joke(): """Return new joke string from icanhazdadjoke.com.""" url = "https://icanhazdadjoke.com/" response = requests.get(url, headers={'Accept': 'application/json'}) raw_joke = response.json() joke ...
en
0.698863
# This script contains the get_joke() function to generate a new dad joke Return new joke string from icanhazdadjoke.com.
3.075229
3
bot/tests/test_triggers/__init__.py
elihschiff/Rubber-Duck-Python
7
7660
from .test_commands import all_commands all_triggers = all_commands from .test_quack import TestQuack all_triggers.append(TestQuack)
from .test_commands import all_commands all_triggers = all_commands from .test_quack import TestQuack all_triggers.append(TestQuack)
none
1
1.19165
1
src/main/scripts/crassus_deployer_lambda.py
Scout24/crassus
0
7661
<reponame>Scout24/crassus from __future__ import print_function from crassus import Crassus from crassus.output_converter import OutputConverter def handler(event, context): crassus = Crassus(event, context) crassus.deploy() def cfn_output_converter(event, context): """ Convert an AWS CloudFormation...
from __future__ import print_function from crassus import Crassus from crassus.output_converter import OutputConverter def handler(event, context): crassus = Crassus(event, context) crassus.deploy() def cfn_output_converter(event, context): """ Convert an AWS CloudFormation output message to our def...
en
0.298993
Convert an AWS CloudFormation output message to our defined ResultMessage format.
2.440094
2
Exareme-Docker/src/exareme/exareme-tools/madis/src/lib/pyreadline/clipboard/__init__.py
tchamabe1979/exareme
0
7662
import sys success = False in_ironpython = "IronPython" in sys.version if in_ironpython: try: from ironpython_clipboard import GetClipboardText, SetClipboardText success = True except ImportError: pass else: try: from win32_clipboard import GetClipboardText, SetClipboardTex...
import sys success = False in_ironpython = "IronPython" in sys.version if in_ironpython: try: from ironpython_clipboard import GetClipboardText, SetClipboardText success = True except ImportError: pass else: try: from win32_clipboard import GetClipboardText, SetClipboardTex...
en
0.447312
Get txt from clipboard. if paste_list==True the convert tab separated data to list of lists. Enclose list of list in array() if all elements are numeric
2.461649
2
mjrl/utils/train_agent.py
YujieLu10/tslam
0
7663
import logging logging.disable(logging.CRITICAL) import math from tabulate import tabulate from mjrl.utils.make_train_plots import make_train_plots from mjrl.utils.gym_env import GymEnv from mjrl.samplers.core import sample_paths import numpy as np import torch import pickle import imageio import time as timer import o...
import logging logging.disable(logging.CRITICAL) import math from tabulate import tabulate from mjrl.utils.make_train_plots import make_train_plots from mjrl.utils.gym_env import GymEnv from mjrl.samplers.core import sample_paths import numpy as np import torch import pickle import imageio import time as timer import o...
en
0.604145
Loads the latest policy. Returns the next step number to begin with. # fresh start # fresh start # find latest policy/baseline # additional # global_status_path = os.path.join(policy_dir, 'global_status.pickle') # with open(global_status_path, 'rb') as fp: # agent.load_global_status( pickle.load(fp) ) # cannot ...
1.841365
2
src/tests/plugins/banktransfer/test_refund_export.py
NicsTr/pretix
0
7664
<gh_stars>0 import json from datetime import timedelta from decimal import Decimal import pytest from django.utils.timezone import now from pretix.base.models import Event, Order, OrderRefund, Organizer, Team, User from pretix.plugins.banktransfer.models import RefundExport from pretix.plugins.banktransfer.views impo...
import json from datetime import timedelta from decimal import Decimal import pytest from django.utils.timezone import now from pretix.base.models import Event, Order, OrderRefund, Organizer, Team, User from pretix.plugins.banktransfer.models import RefundExport from pretix.plugins.banktransfer.views import ( _ro...
none
1
1.826474
2
datawinners/alldata/urls.py
ICT4H/dcs-web
1
7665
<gh_stars>1-10 # vim: ai ts=4 sts=4 et sw=4 encoding=utf-8 from django.conf.urls.defaults import patterns, url from datawinners.alldata.views import get_entity_list_by_type from datawinners.alldata.views import smart_phone_instruction from datawinners.alldata.views import index, reports from datawinners.alldata.views ...
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8 from django.conf.urls.defaults import patterns, url from datawinners.alldata.views import get_entity_list_by_type from datawinners.alldata.views import smart_phone_instruction from datawinners.alldata.views import index, reports from datawinners.alldata.views import failed_s...
fr
0.370952
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
1.812685
2
NewLifeUtils/LoggerModule.py
NewLife1324/NewLifeUtils-Dev
2
7666
<gh_stars>1-10 from NewLifeUtils.ColorModule import ACC, MCC from NewLifeUtils.UtilsModule import hex_to_rgb from NewLifeUtils.FileModule import DataStorage, LogFile from NewLifeUtils.StringUtilModule import remove_csi from datetime import datetime import sys class Formatter(dict): def __init__(self, *args, date_...
from NewLifeUtils.ColorModule import ACC, MCC from NewLifeUtils.UtilsModule import hex_to_rgb from NewLifeUtils.FileModule import DataStorage, LogFile from NewLifeUtils.StringUtilModule import remove_csi from datetime import datetime import sys class Formatter(dict): def __init__(self, *args, date_format="%d-%m-%...
en
0.357801
#81f059}[{time}] {#6bd130}{tag}{#fff}: {#1ed476}{message}", #cfa529}[{time}] {#d7e356}{tag}{#fff}: {#b9c726}{message}", #cf4729}[{time}] {#d93b18}{tag}{#fff}: {#cf2727}{message}", #9c1fd1}[{time}] {#471dc4}{tag}{#fff}: {#219ddb}{message}", #2141a3}[{time}] {#5a51db}{tag}{#fff}: {#2459d6}{message} {#fff}: {#24d0d6}{inpu...
2.290941
2
config/api_urls.py
elcolie/battleship
0
7667
<reponame>elcolie/battleship<filename>config/api_urls.py from rest_framework import routers from boards.api.viewsets import BoardViewSet from fleets.api.viewsets import FleetViewSet from missiles.api.viewsets import MissileViewSet app_name = 'api' router = routers.DefaultRouter() router.register(r'boards', BoardView...
from rest_framework import routers from boards.api.viewsets import BoardViewSet from fleets.api.viewsets import FleetViewSet from missiles.api.viewsets import MissileViewSet app_name = 'api' router = routers.DefaultRouter() router.register(r'boards', BoardViewSet, base_name='board') router.register(r'fleets', FleetV...
none
1
1.819831
2
mealpy/evolutionary_based/MA.py
Alhassan20/mealpy
1
7668
<filename>mealpy/evolutionary_based/MA.py<gh_stars>1-10 #!/usr/bin/env python # ------------------------------------------------------------------------------------------------------% # Created by "<NAME>" at 14:22, 11/04/2020 % # ...
<filename>mealpy/evolutionary_based/MA.py<gh_stars>1-10 #!/usr/bin/env python # ------------------------------------------------------------------------------------------------------% # Created by "<NAME>" at 14:22, 11/04/2020 % # ...
en
0.6147
#!/usr/bin/env python # ------------------------------------------------------------------------------------------------------% # Created by "<NAME>" at 14:22, 11/04/2020 % # ...
2.296615
2
src/estimagic/estimation/estimate_ml.py
OpenSourceEconomics/estimagic
83
7669
from estimagic.inference.ml_covs import cov_cluster_robust from estimagic.inference.ml_covs import cov_hessian from estimagic.inference.ml_covs import cov_jacobian from estimagic.inference.ml_covs import cov_robust from estimagic.inference.ml_covs import cov_strata_robust from estimagic.inference.shared import calculat...
from estimagic.inference.ml_covs import cov_cluster_robust from estimagic.inference.ml_covs import cov_hessian from estimagic.inference.ml_covs import cov_jacobian from estimagic.inference.ml_covs import cov_robust from estimagic.inference.ml_covs import cov_strata_robust from estimagic.inference.shared import calculat...
en
0.72766
Do a maximum likelihood (ml) estimation. This is a high level interface of our lower level functions for maximization, numerical differentiation and inference. It does the full workflow for maximum likelihood estimation with just one function call. While we have good defaults, you can still configure ...
2.084175
2
neural_architecture_search_appendix_a.py
NunoEdgarGFlowHub/neural_architecture_search_with_reinforcement_learning_appendix_a
68
7670
import six import chainer import numpy as np import chainer.links as L import chainer.functions as F import nutszebra_chainer import functools from collections import defaultdict class Conv(nutszebra_chainer.Model): def __init__(self, in_channel, out_channel, filter_size=(3, 3), stride=(1, 1), pad=(1, 1)): ...
import six import chainer import numpy as np import chainer.links as L import chainer.functions as F import nutszebra_chainer import functools from collections import defaultdict class Conv(nutszebra_chainer.Model): def __init__(self, in_channel, out_channel, filter_size=(3, 3), stride=(1, 1), pad=(1, 1)): ...
en
0.858144
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 # register layers # pad along with height # pad along with width
2.467678
2
test/test_proportions_delta.py
quizlet/abracadabra
24
7671
<reponame>quizlet/abracadabra import pytest from abra import Experiment, HypothesisTest def test_large_proportions_delta_expermiment(proportions_data_large): exp = Experiment(proportions_data_large, name='proportions-test') # run 'A/A' test test_aa = HypothesisTest( metric='metric', contr...
import pytest from abra import Experiment, HypothesisTest def test_large_proportions_delta_expermiment(proportions_data_large): exp = Experiment(proportions_data_large, name='proportions-test') # run 'A/A' test test_aa = HypothesisTest( metric='metric', control='A', variation='A', ...
en
0.41088
# run 'A/A' test # run A/B test # run A/B test # run A/B test # run A/B test # run A/A test Small sample sizes defautl to t-tests
2.370993
2
src/bootils/plugins/core/jsw.py
Build-The-Web/bootils
3
7672
# -*- coding: utf-8 -*- # pylint: disable= """ Tanuki Java Service Wrapper runtime environment. Debian JSW paths (Wheezy 3.5.3; Jessie 3.5.22):: /usr/sbin/wrapper – ELF executable /usr/share/wrapper/daemon.sh /usr/share/wrapper/make-wrapper-init.sh /usr/share/wrapper/wrapper.conf "...
# -*- coding: utf-8 -*- # pylint: disable= """ Tanuki Java Service Wrapper runtime environment. Debian JSW paths (Wheezy 3.5.3; Jessie 3.5.22):: /usr/sbin/wrapper – ELF executable /usr/share/wrapper/daemon.sh /usr/share/wrapper/make-wrapper-init.sh /usr/share/wrapper/wrapper.conf "...
en
0.748937
# -*- coding: utf-8 -*- # pylint: disable= Tanuki Java Service Wrapper runtime environment. Debian JSW paths (Wheezy 3.5.3; Jessie 3.5.22):: /usr/sbin/wrapper – ELF executable /usr/share/wrapper/daemon.sh /usr/share/wrapper/make-wrapper-init.sh /usr/share/wrapper/wrapper.conf # Cop...
1.804404
2
MachineLearning/hw1/models/LinearRegression.py
ChoKyuWon/SchoolProjects
0
7673
import numpy as np class LinearRegression: def __init__(self, num_features): self.num_features = num_features self.W = np.zeros((self.num_features, 1)) def train(self, x, y, epochs, batch_size, lr, optim): final_loss = None # loss of final epoch # Training should b...
import numpy as np class LinearRegression: def __init__(self, num_features): self.num_features = num_features self.W = np.zeros((self.num_features, 1)) def train(self, x, y, epochs, batch_size, lr, optim): final_loss = None # loss of final epoch # Training should b...
en
0.653711
# loss of final epoch # Training should be done for 'epochs' times with minibatch size of 'batch_size' # The function 'train' should return the loss of final epoch # Loss of an epoch is calculated as an average of minibatch losses # ========================= EDIT HERE ======================== # xline 과 n번째 y가 매칭됨. f(xl...
3.032826
3
apps/bc_scraper/actions/schedule.py
aurmeneta/ramos-uc
7
7674
<reponame>aurmeneta/ramos-uc<filename>apps/bc_scraper/actions/schedule.py from copy import copy DEFAULT_SCHEDULE = {} for day in "lmwjvs": for mod in "12345678": DEFAULT_SCHEDULE[day + mod] = "'FREE'" def process_schedule(text_sc): """For a given schedule text in BC format, returns the SQL queries f...
from copy import copy DEFAULT_SCHEDULE = {} for day in "lmwjvs": for mod in "12345678": DEFAULT_SCHEDULE[day + mod] = "'FREE'" def process_schedule(text_sc): """For a given schedule text in BC format, returns the SQL queries for inserting the full schedule and schedule info. Those queries have t...
en
0.542325
For a given schedule text in BC format, returns the SQL queries for inserting the full schedule and schedule info. Those queries have to format ID. ### Full Schedule # data rows -> day-day:module,module <> type <> room <><> ### Info Schedule
2.978312
3
openstack_dashboard/dashboards/admin/volumes/views.py
NunoEdgarGFlowHub/horizon
1
7675
# Copyright 2012 Nebula, 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 agree...
# Copyright 2012 Nebula, 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 agree...
en
0.855499
# Copyright 2012 Nebula, 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 agree...
1.693681
2
tests/__init__.py
flowolf/yessssms
6
7676
"""Tests for YesssSMS."""
"""Tests for YesssSMS."""
en
0.746891
Tests for YesssSMS.
1.12382
1
bldr/dep/env.py
bldr-cmd/bldr-cmd
0
7677
<filename>bldr/dep/env.py<gh_stars>0 # This is used by Environment to populate its env # Due to circular dependencies it cannot reference other parts of bldr import toml def default(dotbldr_path: str) -> dict: dep = { 'config': toml.load(f"{dotbldr_path}/dependency.toml"), 'lock': toml.load(f"{dotb...
<filename>bldr/dep/env.py<gh_stars>0 # This is used by Environment to populate its env # Due to circular dependencies it cannot reference other parts of bldr import toml def default(dotbldr_path: str) -> dict: dep = { 'config': toml.load(f"{dotbldr_path}/dependency.toml"), 'lock': toml.load(f"{dotb...
en
0.931071
# This is used by Environment to populate its env # Due to circular dependencies it cannot reference other parts of bldr
2.201642
2
rasa-sample/actions.py
ijufumi/demo-python
0
7678
import re from typing import Any, Text, Dict, List from rasa_sdk import Action, Tracker from rasa_sdk.executor import CollectingDispatcher from rasa_sdk.events import SlotSet import lark_module class ActionHelloWorld(Action): state_map = {} def name(self) -> Text: return "action_hello_world" d...
import re from typing import Any, Text, Dict, List from rasa_sdk import Action, Tracker from rasa_sdk.executor import CollectingDispatcher from rasa_sdk.events import SlotSet import lark_module class ActionHelloWorld(Action): state_map = {} def name(self) -> Text: return "action_hello_world" d...
uk
0.07619
# template="<div></div>",
2.252543
2
parsers/politico.py
plympton/newsdiffs
0
7679
<reponame>plympton/newsdiffs from baseparser import BaseParser, grab_url, logger # Different versions of BeautifulSoup have different properties. # Some work with one site, some with another. # This is BeautifulSoup 3.2. from BeautifulSoup import BeautifulSoup # This is BeautifulSoup 4 import bs4 class PoliticoParse...
from baseparser import BaseParser, grab_url, logger # Different versions of BeautifulSoup have different properties. # Some work with one site, some with another. # This is BeautifulSoup 3.2. from BeautifulSoup import BeautifulSoup # This is BeautifulSoup 4 import bs4 class PoliticoParser(BaseParser): domains = ...
en
0.940811
# Different versions of BeautifulSoup have different properties. # Some work with one site, some with another. # This is BeautifulSoup 3.2. # This is BeautifulSoup 4 # Now we have to switch back to bs3. Hilarious. # and the labeled encoding is wrong, so force utf-8.
2.74895
3
integration-tests/bats/server_multiclient_test.py
fairhopeweb/dolt
2
7680
<filename>integration-tests/bats/server_multiclient_test.py import os import sys from queue import Queue from threading import Thread from helper.pytest import DoltConnection # Utility functions def print_err(e): print(e, file=sys.stderr) def query(dc, query_str): return dc.query(query_str, False) def qu...
<filename>integration-tests/bats/server_multiclient_test.py import os import sys from queue import Queue from threading import Thread from helper.pytest import DoltConnection # Utility functions def print_err(e): print(e, file=sys.stderr) def query(dc, query_str): return dc.query(query_str, False) def qu...
en
0.891769
# Utility functions DELETE FROM test WHERE pk in ( SELECT base_pk FROM dolt_conflicts_test WHERE their_pk IS NULL ); # work functions CREATE TABLE test ( pk INT NOT NULL, c1 INT, c2 INT, PRIMARY KEY(pk)); CREATE TABLE test ( pk INT NOT NULL, c1 INT, c2 INT, PRIMARY KEY(pk)); # test script # work item run by...
1.971394
2
messenger/client/messenger.py
marik348/python-messenger
2
7681
from requests import get, post, exceptions from datetime import datetime from PyQt5 import QtWidgets, QtCore from PyQt5.QtWidgets import QMessageBox from PyQt5.QtGui import QFont from qtwidgets import PasswordEdit from client_commands import (help_client, online, status, myself, reg, role, ban, unban) from client_con...
from requests import get, post, exceptions from datetime import datetime from PyQt5 import QtWidgets, QtCore from PyQt5.QtWidgets import QMessageBox from PyQt5.QtGui import QFont from qtwidgets import PasswordEdit from client_commands import (help_client, online, status, myself, reg, role, ban, unban) from client_con...
en
0.800161
The messenger object acts as the main object and is managed by client. Shows UI and is responsible for UX. UI is separated on 3 main parts, which have their indexes: 0 - Login form, 1 - Registration form, 2 - Chat. Every 5 seconds requests server status. Every second shows new messages, if user logged ...
2.515322
3
oscar/lib/python2.7/site-packages/prompt_toolkit/utils.py
sainjusajan/django-oscar
0
7682
<gh_stars>0 from __future__ import unicode_literals import inspect import os import signal import sys import threading import weakref from wcwidth import wcwidth from six.moves import range __all__ = ( 'Event', 'DummyContext', 'get_cwidth', 'suspend_to_background_supported', 'is_...
from __future__ import unicode_literals import inspect import os import signal import sys import threading import weakref from wcwidth import wcwidth from six.moves import range __all__ = ( 'Event', 'DummyContext', 'get_cwidth', 'suspend_to_background_supported', 'is_conemu_ansi'...
en
0.783349
Simple event to which event handlers can be attached. For instance:: class Cls: def __init__(self): # Define event. The first parameter is the sender. self.event = Event(self) obj = Cls() def handler(sender): pass # ...
2.284971
2
lmdb/cffi.py
hirnimeshrampuresoftware/py-lmdb
185
7683
<reponame>hirnimeshrampuresoftware/py-lmdb # # Copyright 2013 The py-lmdb authors, all rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted only as authorized by the OpenLDAP # Public License. # # A copy of this license is available in the file LICENSE in...
# # Copyright 2013 The py-lmdb authors, all rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted only as authorized by the OpenLDAP # Public License. # # A copy of this license is available in the file LICENSE in the # top-level directory of the distribut...
en
0.697407
# # Copyright 2013 The py-lmdb authors, all rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted only as authorized by the OpenLDAP # Public License. # # A copy of this license is available in the file LICENSE in the # top-level directory of the distribut...
1.481447
1
.virtual_documents/00_core.ipynb.py
AtomScott/image_folder_datasets
0
7684
<gh_stars>0 # default_exp core #hide from nbdev.showdoc import * from fastcore.test import * # export import os import torch from torch import nn from torch.nn import functional as F from torch.utils.data import DataLoader import warnings import torchvision from torchvision.datasets import MNIST, ImageFolder from...
# default_exp core #hide from nbdev.showdoc import * from fastcore.test import * # export import os import torch from torch import nn from torch.nn import functional as F from torch.utils.data import DataLoader import warnings import torchvision from torchvision.datasets import MNIST, ImageFolder from torchvision...
en
0.348988
# default_exp core #hide # export # from pytorch_lightning.metrics.functional import classification, f1 # from fastai.vision.data import ImageDataLoaders # from fastai.vision.augment import Resize #export # Compose([ # Resize(256, interpolation=2), # CenterCrop(224), # ToTens...
1.991793
2
src/modules/iam/module.py
pgorecki/python-ddd
10
7685
from seedwork.application.modules import BusinessModule from modules.iam.application.services import AuthenticationService class IdentityAndAccessModule(BusinessModule): def __init__(self, authentication_service: AuthenticationService): self.authentication_service = authentication_service # @staticm...
from seedwork.application.modules import BusinessModule from modules.iam.application.services import AuthenticationService class IdentityAndAccessModule(BusinessModule): def __init__(self, authentication_service: AuthenticationService): self.authentication_service = authentication_service # @staticm...
en
0.401272
# @staticmethod # def create(container): # assert False # """Factory method for creating a module by using dependencies from a DI container""" # return IdentityAndAccessModule( # logger=container.logger(), # authentication_service=container.authentication_service(), # )
2.350945
2
test_scripts/pyfora2/containerTests.py
ufora/ufora
571
7686
# Copyright 2015 Ufora 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 i...
# Copyright 2015 Ufora 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 i...
en
0.848067
# Copyright 2015 Ufora 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 i...
1.684021
2
src/utils/torch_common.py
quochungto/SIIM-COVID19-Detection
0
7687
import os import gc import random import numpy as np import torch def seed_everything(seed): os.environ['PYTHONHASHSEED'] = str(seed) random.seed(seed) np.random.seed(seed) torch.manual_seed(seed) torch.cuda.manual_seed(seed) torch.backends.cudnn.deterministic = True torch.backends.cudnn.be...
import os import gc import random import numpy as np import torch def seed_everything(seed): os.environ['PYTHONHASHSEED'] = str(seed) random.seed(seed) np.random.seed(seed) torch.manual_seed(seed) torch.cuda.manual_seed(seed) torch.backends.cudnn.deterministic = True torch.backends.cudnn.be...
en
0.715796
Cleans up GPU memory https://github.com/huggingface/transformers/issues/1742
2.35495
2
recipes/freeimage/all/conanfile.py
marsven/conan-center-index
0
7688
from conans import ConanFile, CMake, tools import os import shutil required_conan_version = ">=1.43.0" class FreeImageConan(ConanFile): name = "freeimage" description = "Open Source library project for developers who would like to support popular graphics image formats"\ "like PNG, BMP, JPE...
from conans import ConanFile, CMake, tools import os import shutil required_conan_version = ">=1.43.0" class FreeImageConan(ConanFile): name = "freeimage" description = "Open Source library project for developers who would like to support popular graphics image formats"\ "like PNG, BMP, JPE...
none
1
1.867886
2
src/google/appengine/datastore/datastore_query.py
myelin/appengine-python-standard
0
7689
<reponame>myelin/appengine-python-standard<gh_stars>0 #!/usr/bin/env python # # Copyright 2007 Google LLC # # 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/license...
#!/usr/bin/env python # # Copyright 2007 Google LLC # # 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.807157
#!/usr/bin/env python # # Copyright 2007 Google LLC # # 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.680886
2
tests/Metrics/test_recall.py
Neklaustares-tPtwP/torchflare
1
7690
<reponame>Neklaustares-tPtwP/torchflare # flake8: noqa import warnings import pytest import torch from sklearn.exceptions import UndefinedMetricWarning from sklearn.metrics import recall_score from torchflare.metrics.recall_meter import Recall from torchflare.metrics.meters import _BaseInputHandler torch.manual_seed...
# flake8: noqa import warnings import pytest import torch from sklearn.exceptions import UndefinedMetricWarning from sklearn.metrics import recall_score from torchflare.metrics.recall_meter import Recall from torchflare.metrics.meters import _BaseInputHandler torch.manual_seed(42) def test_binary_inputs(): def...
it
0.238973
# flake8: noqa
2.156482
2
parsing/tests/test_utils.py
davesque/parsing.py
1
7691
<filename>parsing/tests/test_utils.py from __future__ import unicode_literals import unittest from ..utils import compose, flatten, truncate, join, unary, equals class TestEquals(unittest.TestCase): def test_it_should_return_a_function_that_compares_against_x(self): self.assertTrue(equals(234)(234)) ...
<filename>parsing/tests/test_utils.py from __future__ import unicode_literals import unittest from ..utils import compose, flatten, truncate, join, unary, equals class TestEquals(unittest.TestCase): def test_it_should_return_a_function_that_compares_against_x(self): self.assertTrue(equals(234)(234)) ...
none
1
2.748088
3
Array/Final450/Move_Negative_Nums_To_One_End/relative_order_matters/move_negative_nums_to_one_end--insertion_sort_modified.py
prash-kr-meena/GoogleR
0
7692
<reponame>prash-kr-meena/GoogleR from Utils.Array import input_array # Time : O(n2) # Space : O(1) Constant space """ Ill be having 2 pointers here one of them will move through the array looking for -ve numbers to operate on and another will be pointing to the correct location where i can put the -ve elements, aft...
from Utils.Array import input_array # Time : O(n2) # Space : O(1) Constant space """ Ill be having 2 pointers here one of them will move through the array looking for -ve numbers to operate on and another will be pointing to the correct location where i can put the -ve elements, after i find them also this same...
en
0.826033
# Time : O(n2) # Space : O(1) Constant space Ill be having 2 pointers here one of them will move through the array looking for -ve numbers to operate on and another will be pointing to the correct location where i can put the -ve elements, after i find them also this same location will denote the starting of the 1...
4.131996
4
python_test/test_epoll/test_epoll.py
zhtsh/test-examples
0
7693
<reponame>zhtsh/test-examples # coding=utf8 import socket import select from datetime import datetime from datetime import timedelta EOL = b'\n\n' response = b'HTTP/1.0 200 OK\nDate: Mon, 1 Jan 1996 01:01:01 GMT\n' response += b'Content-Type: text/plain\nContent-Length: 13\n\n' response += b'Hello, world!\n...
# coding=utf8 import socket import select from datetime import datetime from datetime import timedelta EOL = b'\n\n' response = b'HTTP/1.0 200 OK\nDate: Mon, 1 Jan 1996 01:01:01 GMT\n' response += b'Content-Type: text/plain\nContent-Length: 13\n\n' response += b'Hello, world!\n' # 创建套接字对象并绑定监听端口 servers...
zh
0.686383
# coding=utf8 # 创建套接字对象并绑定监听端口 # 创建epoll对象,并注册socket对象的 epoll可读事件 # 主循环,epoll的系统调用,一旦有网络IO事件发生,poll调用返回。这是和select系统调用的关键区别 # 通过事件通知获得监听的文件描述符,进而处理 # 注册监听的socket对象可读,获取连接,并注册连接的可读事件 # 连接对象可读,处理客户端发生的信息,并注册连接对象可写 # 连接对象可写事件发生,发送数据到客户端 # responses[fileno] = responses[fileno][byteswritten:] # if len(responses[fileno]) == 0...
3.002098
3
20.2-Donut/Donut2.py
Kehvarl/AdventOfCode2019
1
7694
<gh_stars>1-10 import collections from pprint import pprint example1 = open("input.txt", "r").read() # grid = [[val for val in line] for line in example1.split("\n")] grid = example1.split("\n") length = 0 for line in grid: length = max(len(line), length) out = [] for line in grid: out.append(line[::-1].zfi...
import collections from pprint import pprint example1 = open("input.txt", "r").read() # grid = [[val for val in line] for line in example1.split("\n")] grid = example1.split("\n") length = 0 for line in grid: length = max(len(line), length) out = [] for line in grid: out.append(line[::-1].zfill(length)[::-1...
en
0.536844
# grid = [[val for val in line] for line in example1.split("\n")] # (dot), (tag) # Find portals # For each portal: # Inner edge: recurse # Outer edge: return # print(link, (tx, ty), (px, py), p_edge)
3.354449
3
OR_Client_Library/openrefine_client/tests/test_history.py
idaks/OpenRefine-Provenance-Tools
0
7695
#!/usr/bin/env python """ test_history.py """ # Copyright (c) 2011 <NAME>, Real Programmers. All rights reserved. import unittest from OR_Client_Library.openrefine_client.google.refine.history import * class HistoryTest(unittest.TestCase): def test_init(self): response = { u"code": "ok", ...
#!/usr/bin/env python """ test_history.py """ # Copyright (c) 2011 <NAME>, Real Programmers. All rights reserved. import unittest from OR_Client_Library.openrefine_client.google.refine.history import * class HistoryTest(unittest.TestCase): def test_init(self): response = { u"code": "ok", ...
en
0.593522
#!/usr/bin/env python test_history.py # Copyright (c) 2011 <NAME>, Real Programmers. All rights reserved.
2.67815
3
tests/batch/test_get_batch.py
Remmeauth/remme-core-cli
0
7696
""" Provide tests for command line interface's get batch command. """ import json import pytest from click.testing import CliRunner from cli.constants import ( DEV_BRANCH_NODE_IP_ADDRESS_FOR_TESTING, FAILED_EXIT_FROM_COMMAND_CODE, PASSED_EXIT_FROM_COMMAND_CODE, ) from cli.entrypoint import cli from cli.ut...
""" Provide tests for command line interface's get batch command. """ import json import pytest from click.testing import CliRunner from cli.constants import ( DEV_BRANCH_NODE_IP_ADDRESS_FOR_TESTING, FAILED_EXIT_FROM_COMMAND_CODE, PASSED_EXIT_FROM_COMMAND_CODE, ) from cli.entrypoint import cli from cli.ut...
en
0.874945
Provide tests for command line interface's get batch command. Case: get a batch by identifier. Expect: batch is returned. Case: get a batch by its invalid identifier. Expect: the following identifier is invalid error message. Case: get a batch by its identifier without passing node URL. Expect: batch is ret...
2.508089
3
experiments/scripts/preprocess_dataset.py
pbielak/graph-barlow-twins
9
7697
import sys from gssl.datasets import load_dataset from gssl.inductive.datasets import load_ppi from gssl.utils import seed def main(): seed() # Read dataset name dataset_name = sys.argv[1] # Load dataset if dataset_name == "PPI": load_ppi() else: load_dataset(name=dataset_na...
import sys from gssl.datasets import load_dataset from gssl.inductive.datasets import load_ppi from gssl.utils import seed def main(): seed() # Read dataset name dataset_name = sys.argv[1] # Load dataset if dataset_name == "PPI": load_ppi() else: load_dataset(name=dataset_na...
en
0.208773
# Read dataset name # Load dataset
1.845412
2
agro_site/orders/migrations/0001_initial.py
LukoninDmitryPy/agro_site-2
0
7698
<reponame>LukoninDmitryPy/agro_site-2<filename>agro_site/orders/migrations/0001_initial.py # Generated by Django 2.2.16 on 2022-04-12 13:28 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.db.models.expressions import django.utils.timezone class...
# Generated by Django 2.2.16 on 2022-04-12 13:28 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.db.models.expressions import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ ('sales...
en
0.800953
# Generated by Django 2.2.16 on 2022-04-12 13:28
1.659172
2
app/forms.py
FakeYou/flask-microblog
0
7699
from flask.ext.wtf import Form from wtforms import StringField, BooleanField, PasswordField from wtforms.validators import InputRequired, Email, EqualTo, Length class LoginForm(Form): nickname = StringField('nickname', validators=[InputRequired()]) password = PasswordField('password', validators=[InputRequired...
from flask.ext.wtf import Form from wtforms import StringField, BooleanField, PasswordField from wtforms.validators import InputRequired, Email, EqualTo, Length class LoginForm(Form): nickname = StringField('nickname', validators=[InputRequired()]) password = PasswordField('password', validators=[InputRequired...
none
1
2.819196
3