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
red_panda/aws/templates/redshift.py
jucyai/red-panda
12
6632851
<gh_stars>10-100 SQL_NUM_SLICES = "select count(1) from stv_slices" SQL_LOAD_ERRORS = "select * from stl_load_errors order by starttime desc" SQL_TABLE_INFO = """\ SELECT TRIM(pgn.nspname) AS SCHEMA, TRIM(a.name) AS TABLE, id AS TableId, decode(pgc.reldiststyle, 0, 'EVEN', 1, det.distkey, 8, 'ALL') AS DistKey, decode...
SQL_NUM_SLICES = "select count(1) from stv_slices" SQL_LOAD_ERRORS = "select * from stl_load_errors order by starttime desc" SQL_TABLE_INFO = """\ SELECT TRIM(pgn.nspname) AS SCHEMA, TRIM(a.name) AS TABLE, id AS TableId, decode(pgc.reldiststyle, 0, 'EVEN', 1, det.distkey, 8, 'ALL') AS DistKey, decode(pgc.reldiststyle...
en
0.485333
\ SELECT TRIM(pgn.nspname) AS SCHEMA, TRIM(a.name) AS TABLE, id AS TableId, decode(pgc.reldiststyle, 0, 'EVEN', 1, det.distkey, 8, 'ALL') AS DistKey, decode(pgc.reldiststyle,8, NULL, dist_ratio.ratio::DECIMAL(20,4)) AS Skew, det.head_sort AS "SortKey", det.n_sortkeys AS "#SKs", CASE WHEN pgc.reldiststyle = 8 THEN a.row...
1.865958
2
src/unicms_calendar/migrations/0004_alter_calendarevent_unique_together.py
UniversitaDellaCalabria/unicms-calendar
0
6632852
# Generated by Django 3.2.5 on 2022-01-27 11:25 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('unicms_calendar', '0003_alter_calendarcontext_unique_together'), ] operations = [ migrations.AlterUniqueTogether( name='calendarevent', ...
# Generated by Django 3.2.5 on 2022-01-27 11:25 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('unicms_calendar', '0003_alter_calendarcontext_unique_together'), ] operations = [ migrations.AlterUniqueTogether( name='calendarevent', ...
en
0.856655
# Generated by Django 3.2.5 on 2022-01-27 11:25
1.43371
1
iris_sdk/models/cities.py
NumberAI/python-bandwidth-iris
2
6632853
#!/usr/bin/env python from __future__ import division, absolute_import, print_function from future.builtins import super from iris_sdk.models.base_resource import BaseResource from iris_sdk.models.data.cities import CitiesData XML_NAME_CITIES = "CityResponse" XPATH_RATE_CITIES = "/cities" class Cities(BaseResource,...
#!/usr/bin/env python from __future__ import division, absolute_import, print_function from future.builtins import super from iris_sdk.models.base_resource import BaseResource from iris_sdk.models.data.cities import CitiesData XML_NAME_CITIES = "CityResponse" XPATH_RATE_CITIES = "/cities" class Cities(BaseResource,...
en
0.372921
#!/usr/bin/env python Covered cities directory
2.295004
2
app/auth/forms.py
tgalvinjr/blog-ip
0
6632854
<filename>app/auth/forms.py from flask_wtf import FlaskForm from wtforms import StringField, SubmitField, PasswordField, BooleanField from wtforms.validators import DataRequired, Email, EqualTo, ValidationError from ..models import User class RegistrationForm(FlaskForm): email = StringField('Your Email Address',va...
<filename>app/auth/forms.py from flask_wtf import FlaskForm from wtforms import StringField, SubmitField, PasswordField, BooleanField from wtforms.validators import DataRequired, Email, EqualTo, ValidationError from ..models import User class RegistrationForm(FlaskForm): email = StringField('Your Email Address',va...
none
1
3.091697
3
PythonNetwork/venv/Lib/site-packages/scipy/optimize/_linprog.py
Moldovandreii/RepetitionCount
6,989
6632855
""" A top-level linear programming interface. Currently this interface solves linear programming problems via the Simplex and Interior-Point methods. .. versionadded:: 0.15.0 Functions --------- .. autosummary:: :toctree: generated/ linprog linprog_verbose_callback linprog_terse_callback """ from __...
""" A top-level linear programming interface. Currently this interface solves linear programming problems via the Simplex and Interior-Point methods. .. versionadded:: 0.15.0 Functions --------- .. autosummary:: :toctree: generated/ linprog linprog_verbose_callback linprog_terse_callback """ from __...
en
0.783569
A top-level linear programming interface. Currently this interface solves linear programming problems via the Simplex and Interior-Point methods. .. versionadded:: 0.15.0 Functions --------- .. autosummary:: :toctree: generated/ linprog linprog_verbose_callback linprog_terse_callback A sample callback...
2.959492
3
camcalib/gazeNets.py
ostapstephan/SeniorProject
1
6632856
#!/usr/bin/env python import cv2 import os import subprocess as sp import sys import numpy as np import time import pickle as pk # import datetime from matrix import get_pupil_transformation_matrix from threading import Thread sys.path.append(os.path.abspath('../../TEST')) sys.path.append(os.path.abspath('../../TEST/sh...
#!/usr/bin/env python import cv2 import os import subprocess as sp import sys import numpy as np import time import pickle as pk # import datetime from matrix import get_pupil_transformation_matrix from threading import Thread sys.path.append(os.path.abspath('../../TEST')) sys.path.append(os.path.abspath('../../TEST/sh...
en
0.461544
#!/usr/bin/env python # import datetime # from calibrateHaar import calibrate # from pbcvt import findPupilEllipse # from params import pupil_tracker_params # from cameras import cam1mat as cameraMatrix1 # from cameras import cam1dcoef as distCoeffs1 This code will be able to open fast and low latency streams and captu...
1.904953
2
bin/model_funcs/fortran_versions/turb2_wrap.py
AlexT-L/RANS
0
6632857
# updates eddy viscosity (ev/rev) # append to path so we can access Field class import sys sys.path.append("../../../") # class dependencies import numpy as np from bin.Field import Field, max, abs, isfinite # fortran module from bin.model_funcs.fortran_versions import turb2_fort def turb_BL(model,ws,w,ncyc=0): ...
# updates eddy viscosity (ev/rev) # append to path so we can access Field class import sys sys.path.append("../../../") # class dependencies import numpy as np from bin.Field import Field, max, abs, isfinite # fortran module from bin.model_funcs.fortran_versions import turb2_fort def turb_BL(model,ws,w,ncyc=0): ...
en
0.440956
# updates eddy viscosity (ev/rev) # append to path so we can access Field class # class dependencies # fortran module # grid parameters # flow related variabless # pressure # eddy viscosity # mesh vars # flow params # call turb
2.403036
2
src/python3/sdp/scripts/nstx_reflectometry/nstx_equi_plot.py
LeiShi/Synthetic-Diagnostics-Platform
5
6632858
<gh_stars>1-10 from scipy.io.netcdf import netcdf_file import numpy as np import matplotlib.pyplot as plt eqf = netcdf_file('/p/gkp/lshi/XGC1_NSTX_Case/new_3D_fluctuations/time_step_8/eqfile108.cdf','r') ne = eqf.variables['ne'] r = eqf.variables['rr'][:] nz = eqf.dimensions['nz'] midz = (nz-1)/2 ne_midz = ne[midz,:...
from scipy.io.netcdf import netcdf_file import numpy as np import matplotlib.pyplot as plt eqf = netcdf_file('/p/gkp/lshi/XGC1_NSTX_Case/new_3D_fluctuations/time_step_8/eqfile108.cdf','r') ne = eqf.variables['ne'] r = eqf.variables['rr'][:] nz = eqf.dimensions['nz'] midz = (nz-1)/2 ne_midz = ne[midz,:] freqs = np.a...
none
1
1.82854
2
enamlkv/kv/kv_mime_data.py
frmdstryr/enaml-kivy
1
6632859
<gh_stars>1-10 #------------------------------------------------------------------------------ # Copyright (c) 2016, frmdstryr. # Copyright (c) 2014, Nucleic Development Team. # # Distributed under the terms of the MIT License. # # The full license is in the file LICENSE, distributed with this software. #--------------...
#------------------------------------------------------------------------------ # Copyright (c) 2016, frmdstryr. # Copyright (c) 2014, Nucleic Development Team. # # Distributed under the terms of the MIT License. # # The full license is in the file LICENSE, distributed with this software. #-----------------------------...
en
0.391176
#------------------------------------------------------------------------------ # Copyright (c) 2016, frmdstryr. # Copyright (c) 2014, Nucleic Development Team. # # Distributed under the terms of the MIT License. # # The full license is in the file LICENSE, distributed with this software. #-----------------------------...
2.140404
2
Medium/127.py
Hellofafar/Leetcode
6
6632860
# ------------------------------ # 127. Word Ladder # # Description: # Given two words (beginWord and endWord), and a dictionary's word list, find the length of shortest transformation sequence from beginWord to endWord, such that: # Only one letter can be changed at a time. # Each transformed word must exist in the w...
# ------------------------------ # 127. Word Ladder # # Description: # Given two words (beginWord and endWord), and a dictionary's word list, find the length of shortest transformation sequence from beginWord to endWord, such that: # Only one letter can be changed at a time. # Each transformed word must exist in the w...
en
0.785841
# ------------------------------ # 127. Word Ladder # # Description: # Given two words (beginWord and endWord), and a dictionary's word list, find the length of shortest transformation sequence from beginWord to endWord, such that: # Only one letter can be changed at a time. # Each transformed word must exist in the wo...
3.925987
4
pyepisodate/__init__.py
guiszk/pyepisodate
0
6632861
from .pyepisodate import pyepisodate
from .pyepisodate import pyepisodate
none
1
1.034458
1
ocr/mlhelpers.py
manhcuogntin4/handwritting-ocr
0
6632862
<reponame>manhcuogntin4/handwritting-ocr<filename>ocr/mlhelpers.py # -*- coding: utf-8 -*- """ Classes for controling machine learning processes """ import numpy as np import math import matplotlib.pyplot as plt import csv class TrainingPlot: """ Creating live plot during training REUIRES notebook backen...
# -*- coding: utf-8 -*- """ Classes for controling machine learning processes """ import numpy as np import math import matplotlib.pyplot as plt import csv class TrainingPlot: """ Creating live plot during training REUIRES notebook backend: %matplotlib notebook @TODO Migrate to Tensorboard """ ...
en
0.773097
# -*- coding: utf-8 -*- Classes for controling machine learning processes Creating live plot during training REUIRES notebook backend: %matplotlib notebook @TODO Migrate to Tensorboard # Description # Axes limits Class for training data and feeding train function Crate the dataset Return the next batch from th...
3.014441
3
webhelpers2/tests/test_date.py
dairiki/WebHelpers2
0
6632863
<reponame>dairiki/WebHelpers2<filename>webhelpers2/tests/test_date.py import calendar from datetime import datetime as DT import time from pytest import fixture, raises from webhelpers2.date import distance_of_time_in_words as dtw from webhelpers2.date import time_ago_in_words from webhelpers2.date import _is_leap_ye...
import calendar from datetime import datetime as DT import time from pytest import fixture, raises from webhelpers2.date import distance_of_time_in_words as dtw from webhelpers2.date import time_ago_in_words from webhelpers2.date import _is_leap_year @fixture(params=range(1970, 2100, 5)) def run_in_various_years(req...
en
0.940471
Monkeypatch time.time() to midnight UTC on Jan 1 of various years. The assortment of years includes both leap years and non-leap years. # Midnight, Jan 1 2000 UTC # 12:32pm, May 5, 1980 # Test that if integers are supplied they are interpreted as seconds from now # The following two tests test the span from "now" ...
3.149146
3
autobet/util.py
Arter3r/gta-autobet
3
6632864
from functools import lru_cache from autobet.constants import GAME_EXECUTABLE, ASPECT_RATIO, START_SCREEN_TOP_LEFT_PIXEL_RGB, RESULTS_SCREEN_TOP_LEFT_PIXEL_RGB, PLACE_BET_SCREEN_TOP_LEFT_PIXEL_RGB import pyautogui import autobet.constants def log(msg): # TODO proper logging print(msg) @lru_cache(maxsize=1) def get...
from functools import lru_cache from autobet.constants import GAME_EXECUTABLE, ASPECT_RATIO, START_SCREEN_TOP_LEFT_PIXEL_RGB, RESULTS_SCREEN_TOP_LEFT_PIXEL_RGB, PLACE_BET_SCREEN_TOP_LEFT_PIXEL_RGB import pyautogui import autobet.constants def log(msg): # TODO proper logging print(msg) @lru_cache(maxsize=1) def get...
en
0.410794
# TODO proper logging
2.318921
2
benchmark_tensorflow.py
ryoma-jp/009_Benchmark
0
6632865
<reponame>ryoma-jp/009_Benchmark<filename>benchmark_tensorflow.py #! -*- coding: utf-8 -*- """ [tensorflow] python benchmark_tensorflow.py --help python benchmark_tensorflow.py --param_csv benchmark.csv """ #--------------------------------- # モジュールのインポート #--------------------------------- import os im...
#! -*- coding: utf-8 -*- """ [tensorflow] python benchmark_tensorflow.py --help python benchmark_tensorflow.py --param_csv benchmark.csv """ #--------------------------------- # モジュールのインポート #--------------------------------- import os import sys import time import tqdm import argparse from argparse imp...
ja
0.527137
#! -*- coding: utf-8 -*- [tensorflow] python benchmark_tensorflow.py --help python benchmark_tensorflow.py --param_csv benchmark.csv #--------------------------------- # モジュールのインポート #--------------------------------- #--------------------------------- # 定数定義 #--------------------------------- #------------...
2.50884
3
pandas_market_calendars/exchange_calendar_six.py
rakesh1988/pandas_market_calendars
1
6632866
from datetime import time from pandas.tseries.holiday import (AbstractHolidayCalendar, Day, Easter, EasterMonday, GoodFriday, Holiday, previous_friday) from pytz import timezone from .market_calendar import (FRIDAY, MONDAY, MarketCalendar, THURSDAY, TUESDAY, WEDNESDAY) # New Year'...
from datetime import time from pandas.tseries.holiday import (AbstractHolidayCalendar, Day, Easter, EasterMonday, GoodFriday, Holiday, previous_friday) from pytz import timezone from .market_calendar import (FRIDAY, MONDAY, MarketCalendar, THURSDAY, TUESDAY, WEDNESDAY) # New Year'...
en
0.683648
# New Year's Eve # New Year's Day # Berthold's Day # Early May bank holiday # Ascension Day (Auffahrt) # Pentecost Day (Pfingstmontag) # Swiss National Day # Christmas Eve # Christmas # Boxing day Exchange calendar for SIX
2.933609
3
src/features/onset_features.py
L-Hess/HexClassifier
0
6632867
import numpy as np class GetFeatures: def __init__(self, input_filepaths, output_filepath): self.input_data_0 = np.genfromtxt(input_filepaths[0], delimiter=',', skip_header=False) self.input_data_1 = np.genfromtxt(input_filepaths[1], delimiter=',', skip_header=False) self.log_path = input...
import numpy as np class GetFeatures: def __init__(self, input_filepaths, output_filepath): self.input_data_0 = np.genfromtxt(input_filepaths[0], delimiter=',', skip_header=False) self.input_data_1 = np.genfromtxt(input_filepaths[1], delimiter=',', skip_header=False) self.log_path = input...
en
0.954334
# Keep track if trial is active by log files
2.418387
2
gym/envs/classic_control/path_finding_data_collect.py
DragonMyth/MyDartEnv
0
6632868
<reponame>DragonMyth/MyDartEnv """ Classic cart-pole system implemented by <NAME> et al. Copied from http://incompleteideas.net/sutton/book/code/pole.c permalink: https://perma.cc/C9ZM-652R """ import logging import math import gym from gym import spaces from gym.utils import seeding import numpy as np logger = loggi...
""" Classic cart-pole system implemented by <NAME> et al. Copied from http://incompleteideas.net/sutton/book/code/pole.c permalink: https://perma.cc/C9ZM-652R """ import logging import math import gym from gym import spaces from gym.utils import seeding import numpy as np logger = logging.getLogger(__name__) class ...
en
0.622427
Classic cart-pole system implemented by <NAME> et al. Copied from http://incompleteideas.net/sutton/book/code/pole.c permalink: https://perma.cc/C9ZM-652R # This is the goal grid # self.point_mass_trans = None # # print(i_after, j_after) # # print(q) # idx,idy = self.pos_to_grid_idx(q) # print(idx,idy) # posx,posy = se...
2.577783
3
tensorflow/python/platform/benchmark.py
JianGoForIt/tensorflow
0
6632869
<filename>tensorflow/python/platform/benchmark.py # Copyright 2016 Google 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/LICE...
<filename>tensorflow/python/platform/benchmark.py # Copyright 2016 Google 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/LICE...
en
0.800591
# Copyright 2016 Google 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 a...
2.110451
2
base_market_agent/__init__.py
shwethanidd/volttron-GS
1
6632870
<reponame>shwethanidd/volttron-GS<gh_stars>1-10 # -*- coding: utf-8 -*- {{{ # vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: # Copyright (c) 2017, Battelle Memorial Institute # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the...
# -*- coding: utf-8 -*- {{{ # vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: # Copyright (c) 2017, Battelle Memorial Institute # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistri...
en
0.89087
# -*- coding: utf-8 -*- {{{ # vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: # Copyright (c) 2017, Battelle Memorial Institute # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistrib...
0.92582
1
grr/server/instant_output_plugin.py
panhania/grr
0
6632871
#!/usr/bin/env python """Instant output plugins used by the API for on-the-fly conversion.""" import itertools import re from grr.lib import rdfvalue from grr.lib import registry from grr.lib import utils from grr.server import aff4 from grr.server import export class InstantOutputPlugin(object): """The base clas...
#!/usr/bin/env python """Instant output plugins used by the API for on-the-fly conversion.""" import itertools import re from grr.lib import rdfvalue from grr.lib import registry from grr.lib import utils from grr.server import aff4 from grr.server import export class InstantOutputPlugin(object): """The base clas...
en
0.76005
#!/usr/bin/env python Instant output plugins used by the API for on-the-fly conversion. The base class for instant output plugins. Instant output plugins do on-the-fly data conversion and are used in GetExportedFlowResults/GetExportedHuntResults methods. # pylint: disable=g-bad-name OutputPlugin constructor. ...
2.385118
2
redis_client.py
amirothman/deck-of-cards-as-a-service
1
6632872
from redis import StrictRedis redis_client = StrictRedis(decode_responses=True)
from redis import StrictRedis redis_client = StrictRedis(decode_responses=True)
none
1
1.163763
1
source/AI_game/Feed_Forward_Neural_Network.py
anshulp2912/Slytherin-Game-using-Genetic-Algorithm
0
6632873
import numpy as np n_x = 7 n_h = 9 n_h2 = 15 n_y = 3 W1_shape = (9,7) W2_shape = (15,9) W3_shape = (3,15) def get_weights_from_encoded(individual): W1 = individual[0:W1_shape[0] * W1_shape[1]] W2 = individual[W1_shape[0] * W1_shape[1]:W2_shape[0] * W2_shape[1] + W1_shape[0] * W1_shape[1]] W3 = individual[...
import numpy as np n_x = 7 n_h = 9 n_h2 = 15 n_y = 3 W1_shape = (9,7) W2_shape = (15,9) W3_shape = (3,15) def get_weights_from_encoded(individual): W1 = individual[0:W1_shape[0] * W1_shape[1]] W2 = individual[W1_shape[0] * W1_shape[1]:W2_shape[0] * W2_shape[1] + W1_shape[0] * W1_shape[1]] W3 = individual[...
none
1
2.873835
3
kats/utils/decomposition.py
koushikroy/Kats
1
6632874
# Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import logging from typing import Any, Dict, Optional, Sequence, Tuple, Union import matplotlib.pyplot as plt import numpy as np import pandas ...
# Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import logging from typing import Any, Dict, Optional, Sequence, Tuple, Union import matplotlib.pyplot as plt import numpy as np import pandas ...
en
0.835982
# Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # from numpy.typing import ArrayLike Model class for Time Series Decomposition. This class provides utilities to decompose an input time ser...
2.632339
3
aid/pycopia/ascii.py
kdart/pycopia
89
6632875
<reponame>kdart/pycopia #!/usr/bin/python # -*- coding: us-ascii -*- # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab # ASCII text classified into named sets. lowercase = 'abcdefghijklmnopqrstuvwxyz' uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' digits = '0123456789' hexdigits = '0123456789ABCDEF' letters = lowercase + up...
#!/usr/bin/python # -*- coding: us-ascii -*- # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab # ASCII text classified into named sets. lowercase = 'abcdefghijklmnopqrstuvwxyz' uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' digits = '0123456789' hexdigits = '0123456789ABCDEF' letters = lowercase + uppercase alphanumeric = l...
en
0.237343
#!/usr/bin/python # -*- coding: us-ascii -*- # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab # ASCII text classified into named sets. !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
2.860444
3
puv.py
beachpeeps/puv_process
0
6632876
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jul 18 12:03:37 2019 @author: cassandra """ import pandas as pd import numpy as np import gc import linear_wave_convert g = 9.81 rho = 1025 def get_k(omega, h): """ Linear wave dispersion relation solver Given to me in matlab by <NAME>, ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jul 18 12:03:37 2019 @author: cassandra """ import pandas as pd import numpy as np import gc import linear_wave_convert g = 9.81 rho = 1025 def get_k(omega, h): """ Linear wave dispersion relation solver Given to me in matlab by <NAME>, ...
en
0.732634
#!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Thu Jul 18 12:03:37 2019 @author: cassandra Linear wave dispersion relation solver Given to me in matlab by <NAME>, implemented in Python by me Take a NortekVector output file set (.dat and .vhd files only) and convert them into csv files with times and...
2.756213
3
django/esite/customer/views.py
vollov/django-template
0
6632877
from django.shortcuts import render_to_response, get_object_or_404 from models import Customer def get_customers(request): customers = Customer.objects.filter(active=True) return render_to_response('list.html', { 'page_title': 'Customers', 'customers': customers, })
from django.shortcuts import render_to_response, get_object_or_404 from models import Customer def get_customers(request): customers = Customer.objects.filter(active=True) return render_to_response('list.html', { 'page_title': 'Customers', 'customers': customers, })
none
1
1.988791
2
pymeasure/instruments/anritsu/anritsuMG3692C.py
Endever42/pymeasure
2
6632878
<filename>pymeasure/instruments/anritsu/anritsuMG3692C.py # # This file is part of the PyMeasure package. # # Copyright (c) 2013-2019 PyMeasure Developers # # 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...
<filename>pymeasure/instruments/anritsu/anritsuMG3692C.py # # This file is part of the PyMeasure package. # # Copyright (c) 2013-2019 PyMeasure Developers # # 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...
en
0.769969
# # This file is part of the PyMeasure package. # # Copyright (c) 2013-2019 PyMeasure Developers # # 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 limit...
1.590855
2
problems/A/ExercisingWalk.py
deveshbajpai19/CodeForces
55
6632879
<reponame>deveshbajpai19/CodeForces __author__ = '<NAME>' ''' https://codeforces.com/problemset/problem/1332/A Solution: Mostly we need to calculate the net distance to move in both dimensions. That should be in the range [x1, x2] and [y1, y2] respectively. There is a special case when we are required to move positiv...
__author__ = '<NAME>' ''' https://codeforces.com/problemset/problem/1332/A Solution: Mostly we need to calculate the net distance to move in both dimensions. That should be in the range [x1, x2] and [y1, y2] respectively. There is a special case when we are required to move positive distance in each dimension and the...
en
0.917542
https://codeforces.com/problemset/problem/1332/A Solution: Mostly we need to calculate the net distance to move in both dimensions. That should be in the range [x1, x2] and [y1, y2] respectively. There is a special case when we are required to move positive distance in each dimension and there in space to move (i.e. x...
3.696386
4
solum/tests/common/test_solum_keystoneclient.py
ed-/solum
0
6632880
# Copyright 2014 - Rackspace Hosting. # # 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 2014 - Rackspace Hosting. # # 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.809394
# Copyright 2014 - Rackspace Hosting. # # 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.799396
2
preprocessing_tools/generate_phi0.py
ReneVelasquez18/PYGBE
0
6632881
<reponame>ReneVelasquez18/PYGBE #!/usr/bin/env python """ It generates a .phi0 for a sensor brick. The user has to set the values of dphi/dn on each face of the brick. The surface charge \sigma is usually units of C/m^2. However, the code takes as input dphi/dn which has to be in units of electron charge and angstrom...
#!/usr/bin/env python """ It generates a .phi0 for a sensor brick. The user has to set the values of dphi/dn on each face of the brick. The surface charge \sigma is usually units of C/m^2. However, the code takes as input dphi/dn which has to be in units of electron charge and angstrom^2. dphi/dn = - sigma / epsilon...
en
0.867509
#!/usr/bin/env python It generates a .phi0 for a sensor brick. The user has to set the values of dphi/dn on each face of the brick. The surface charge \sigma is usually units of C/m^2. However, the code takes as input dphi/dn which has to be in units of electron charge and angstrom^2. dphi/dn = - sigma / epsilon the...
4.025391
4
wieracentral/gen-py/ApplicationToWieraIface/ApplicationToWieraIface.py
LiPengze97/wiera
0
6632882
<filename>wieracentral/gen-py/ApplicationToWieraIface/ApplicationToWieraIface.py # # Autogenerated by Thrift Compiler (0.10.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException fro...
<filename>wieracentral/gen-py/ApplicationToWieraIface/ApplicationToWieraIface.py # # Autogenerated by Thrift Compiler (0.10.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException fro...
en
0.370028
# # Autogenerated by Thrift Compiler (0.10.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # Parameters: - policy Parameters: - key Parameters: - key Parameters: - policy Parameters: - key Parameters: - key # HELPER FU...
1.892869
2
pyEmitter/Event.py
archanpatkar/pyEmitter
4
6632883
<reponame>archanpatkar/pyEmitter from collections import namedtuple Event = namedtuple('Event', ['name', 'value']);
from collections import namedtuple Event = namedtuple('Event', ['name', 'value']);
none
1
2.136976
2
python/code_challenges/linkedListPractice/llpractice.py
brendanwelzien/data-structures-and-algorithms
0
6632884
class Node: def __init__(self, value, _next=None): self.value = val self.next = _next def __repr__(self): return f"{self.next}'s value is {self.value}" class linkedList: def __init__(self): self.head = None def insert(self, val): self.head = Node(value, self.he...
class Node: def __init__(self, value, _next=None): self.value = val self.next = _next def __repr__(self): return f"{self.next}'s value is {self.value}" class linkedList: def __init__(self): self.head = None def insert(self, val): self.head = Node(value, self.he...
en
0.36443
# check if value exists in Node # More linked list tomorrow
4.06169
4
5.py
daniiarkhodzhaev-at/lab2
0
6632885
<gh_stars>0 #!/usr/bin/python3 import turtle def draw_square(size: int) -> int: turtle.penup() turtle.goto(-size / 2, -size // 2) turtle.pendown() for i in range(4): turtle.forward(size) turtle.left(90) return 0 def main() -> int: turtle.shape("turtle") for i in range(1, 1...
#!/usr/bin/python3 import turtle def draw_square(size: int) -> int: turtle.penup() turtle.goto(-size / 2, -size // 2) turtle.pendown() for i in range(4): turtle.forward(size) turtle.left(90) return 0 def main() -> int: turtle.shape("turtle") for i in range(1, 11): ...
fr
0.386793
#!/usr/bin/python3
4.024801
4
tests/integration/cqlengine/model/test_polymorphism.py
beobal/python-driver
1
6632886
<filename>tests/integration/cqlengine/model/test_polymorphism.py<gh_stars>1-10 # Copyright 2015 DataStax, 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/licens...
<filename>tests/integration/cqlengine/model/test_polymorphism.py<gh_stars>1-10 # Copyright 2015 DataStax, 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/licens...
en
0.929759
# Copyright 2015 DataStax, 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.125828
2
tests/unit/test_utils.py
ag0n1k/notion-bot
0
6632887
<gh_stars>0 from nbot.utils import get_domain, get_omdb_id, create_buttons, MetaSingleton def test_domain(): assert get_domain("http://youtube.com/aw2asd/") == "youtube.com" assert get_domain("http://www.youtube.com/aw2asd/") == "youtube.com" def test_positive_omdb_id(): assert get_omdb_id("https://www....
from nbot.utils import get_domain, get_omdb_id, create_buttons, MetaSingleton def test_domain(): assert get_domain("http://youtube.com/aw2asd/") == "youtube.com" assert get_domain("http://www.youtube.com/aw2asd/") == "youtube.com" def test_positive_omdb_id(): assert get_omdb_id("https://www.imdb.com/tit...
none
1
2.239746
2
Bindings/Python/examples/Moco/exampleHangingMuscle.py
gmiilp1318/opensim-core
0
6632888
# -------------------------------------------------------------------------- # # OpenSim Moco: exampleHangingMuscle.py # # -------------------------------------------------------------------------- # # Copyright (c) 2020 Stanford University and the Authors # # ...
# -------------------------------------------------------------------------- # # OpenSim Moco: exampleHangingMuscle.py # # -------------------------------------------------------------------------- # # Copyright (c) 2020 Stanford University and the Authors # # ...
en
0.848376
# -------------------------------------------------------------------------- # # OpenSim Moco: exampleHangingMuscle.py # # -------------------------------------------------------------------------- # # Copyright (c) 2020 Stanford University and the Authors # # ...
2.3884
2
logic/Anomaly.py
futuristicmeme/Deep-Geospatial
1
6632889
from keras.layers import Input, Conv2D, MaxPooling2D, UpSampling2D, LeakyReLU, Dense from keras.callbacks import TensorBoard from keras.models import Model, load_model import keras.backend as K from keras.utils.vis_utils import plot_model import tensorflow as tf from skimage import io import numpy as np from sklearn.cr...
from keras.layers import Input, Conv2D, MaxPooling2D, UpSampling2D, LeakyReLU, Dense from keras.callbacks import TensorBoard from keras.models import Model, load_model import keras.backend as K from keras.utils.vis_utils import plot_model import tensorflow as tf from skimage import io import numpy as np from sklearn.cr...
en
0.714306
A class which creates an autoencoder designed for detecting anomalies in Google Maps imagery Anomaly Constructor Args: res_x: The latitude of the location required res_y: The longitude of the location required code_dim: Coded layer di...
2.841525
3
data structures/linklist.py
iFun/Project-G
0
6632890
<filename>data structures/linklist.py import unittest class Node(): """LinkedList node class""" def __init__(self, value): self.value = value self.next = None self.prev = None def __str__(self): """Override the default print behavior""" if self.next is not None: ...
<filename>data structures/linklist.py import unittest class Node(): """LinkedList node class""" def __init__(self, value): self.value = value self.next = None self.prev = None def __str__(self): """Override the default print behavior""" if self.next is not None: ...
en
0.408704
LinkedList node class Override the default print behavior Override the default Equals behavior docstring for LinkedList reverse the linkedlist create a new linklist before each unit test
4.028897
4
experiments/custom_classifier.py
FabioTomaz/msc
0
6632891
<gh_stars>0 import os import tensorflow as tf from tensorflow.keras import backend as K from tensorflow.keras.layers import Conv2D, MaxPooling2D, GlobalAveragePooling2D, Dropout, Dense, Activation from tensorflow.keras.models import Sequential from tensorflow.keras.optimizers import Adam from tensorflow.keras.applicati...
import os import tensorflow as tf from tensorflow.keras import backend as K from tensorflow.keras.layers import Conv2D, MaxPooling2D, GlobalAveragePooling2D, Dropout, Dense, Activation from tensorflow.keras.models import Sequential from tensorflow.keras.optimizers import Adam from tensorflow.keras.applications import i...
en
0.587372
NOT IMPLEMENTED!!! Model trained from scratch for skin lesion classification Preprocesses a numpy array encoding a batch of images. # Arguments x: a 4D numpy array consists of RGB values within [0, 255]. # Returns Preprocessed array.
2.293874
2
nominations/nominations/models.py
walshs33/sweng2018group
0
6632892
<gh_stars>0 from django.db import models from django.urls import reverse from django.contrib.auth.models import User from django.db.models.signals import post_save from django.dispatch import receiver #https://simpleisbetterthancomplex.com/tutorial/2016/07/22/how-to-extend-django-user-model.html#onetoone class Profile(...
from django.db import models from django.urls import reverse from django.contrib.auth.models import User from django.db.models.signals import post_save from django.dispatch import receiver #https://simpleisbetterthancomplex.com/tutorial/2016/07/22/how-to-extend-django-user-model.html#onetoone class Profile(models.Model...
en
0.348374
#https://simpleisbetterthancomplex.com/tutorial/2016/07/22/how-to-extend-django-user-model.html#onetoone class EncForm(models.Model): encdata dept_id level submitter
2.404324
2
hallo/modules/dailys/field_sleep.py
joshcoales/Hallo
1
6632893
from datetime import timedelta from hallo.events import EventMessage import hallo.modules.dailys.dailys_field class DailysSleepField(hallo.modules.dailys.dailys_field.DailysField): # Does sleep and wake times, sleep notes, dream logs, shower? type_name = "sleep" WAKE_WORDS = ["morning", "wake", "woke"] ...
from datetime import timedelta from hallo.events import EventMessage import hallo.modules.dailys.dailys_field class DailysSleepField(hallo.modules.dailys.dailys_field.DailysField): # Does sleep and wake times, sleep notes, dream logs, shower? type_name = "sleep" WAKE_WORDS = ["morning", "wake", "woke"] ...
en
0.925797
# Does sleep and wake times, sleep notes, dream logs, shower? :type evt: EventMessage :rtype: None # If user is waking up # If today's data is blank, write in yesterday's sleep data # If you already woke in this data, why are you waking again? # If not, add a wake time to sleep data # If user is going to sleep ...
2.995733
3
qmla/exploration_strategies/nv_centre_spin_characterisation/nature_physics_2021/varying_true_model.py
flynnbr11/QMD
9
6632894
<gh_stars>1-10 from __future__ import absolute_import import sys import os import random import qmla.model_building_utilities from qmla.exploration_strategies.nv_centre_spin_characterisation.nature_physics_2021 import ( FullAccessNVCentre, TieredGreedySearchNVCentre, ) __all__ = ["VariableTrueModelNVCentre"] ...
from __future__ import absolute_import import sys import os import random import qmla.model_building_utilities from qmla.exploration_strategies.nv_centre_spin_characterisation.nature_physics_2021 import ( FullAccessNVCentre, TieredGreedySearchNVCentre, ) __all__ = ["VariableTrueModelNVCentre"] class Variabl...
en
0.620562
# FullAccessNVCentre Cycle through target model.
2.275295
2
tests/factors/test_technical_factor.py
doncat99/zvt
10
6632895
<reponame>doncat99/zvt<gh_stars>1-10 # -*- coding: utf-8 -*- from zvt.api.data_type import Region, Provider from zvt.contract import IntervalLevel from zvt.factors.algorithm import MaTransformer, MacdTransformer from zvt.factors.ma.ma_factor import CrossMaFactor from zvt.factors.technical_factor import TechnicalFactor ...
# -*- coding: utf-8 -*- from zvt.api.data_type import Region, Provider from zvt.contract import IntervalLevel from zvt.factors.algorithm import MaTransformer, MacdTransformer from zvt.factors.ma.ma_factor import CrossMaFactor from zvt.factors.technical_factor import TechnicalFactor from ..context import init_test_conte...
en
0.924414
# -*- coding: utf-8 -*- # compare with east money manually # compare with east money manually
1.915077
2
ibis/backends/impala/__init__.py
GrapeBaBa/ibis
0
6632896
<filename>ibis/backends/impala/__init__.py """Impala backend""" from __future__ import annotations import contextlib import io import operator import re import weakref from posixpath import join as pjoin from typing import Any try: from typing import Literal except ImportError: from typing_extensions import ...
<filename>ibis/backends/impala/__init__.py """Impala backend""" from __future__ import annotations import contextlib import io import operator import re import weakref from posixpath import join as pjoin from typing import Any try: from typing import Literal except ImportError: from typing_extensions import ...
en
0.638286
Impala backend # noqa F408 Create an Impala Backend for use with Ibis. Parameters ---------- host Host name of the impalad or HiveServer2 in Hive port Impala's HiveServer2 port database Default database when obtaining new cursors timeo...
1.803029
2
cvxpy/atoms/affine/diag.py
NunoEdgarGFlowHub/cvxpy
0
6632897
<gh_stars>0 """ Copyright 2013 <NAME> This file is part of CVXPY. CVXPY is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. CVXPY is distribut...
""" Copyright 2013 <NAME> This file is part of CVXPY. CVXPY is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. CVXPY is distributed in the ho...
en
0.790343
Copyright 2013 <NAME> This file is part of CVXPY. CVXPY is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. CVXPY is distributed in the hope t...
2.988561
3
pydle/client.py
benshu/pydle
0
6632898
<reponame>benshu/pydle<filename>pydle/client.py<gh_stars>0 ## client.py # Basic IRC client implementation. import time import datetime import itertools import logging from . import async from . import connection from . import protocol __all__ = [ 'Error', 'AlreadyInChannel', 'NotInChannel', 'BasicClient' ] PING_TIMEO...
## client.py # Basic IRC client implementation. import time import datetime import itertools import logging from . import async from . import connection from . import protocol __all__ = [ 'Error', 'AlreadyInChannel', 'NotInChannel', 'BasicClient' ] PING_TIMEOUT = 300 DEFAULT_NICKNAME = '<unregistered>' class Error(...
en
0.843198
## client.py # Basic IRC client implementation. Base class for all pydle errors. Base IRC client class. This class on its own is not complete: in order to be able to run properly, _has_message, _parse_message and _create_message have to be overloaded. Create a client. Reset attributes. # Record-keeping. # Low-level...
2.428536
2
dassl/data/datasets/da/digit5.py
Fyy10/Dassl.pytorch
563
6632899
import random import os.path as osp from dassl.utils import listdir_nohidden from ..build import DATASET_REGISTRY from ..base_dataset import Datum, DatasetBase # Folder names for train and test sets MNIST = {"train": "train_images", "test": "test_images"} MNIST_M = {"train": "train_images", "test": "test_images"} SV...
import random import os.path as osp from dassl.utils import listdir_nohidden from ..build import DATASET_REGISTRY from ..base_dataset import Datum, DatasetBase # Folder names for train and test sets MNIST = {"train": "train_images", "test": "test_images"} MNIST_M = {"train": "train_images", "test": "test_images"} SV...
en
0.856902
# Folder names for train and test sets Five digit datasets. It contains: - MNIST: hand-written digits. - MNIST-M: variant of MNIST with blended background. - SVHN: street view house number. - SYN: synthetic digits. - USPS: hand-written digits, slightly different from MNIST. ...
2.313712
2
for.py
brauliorivas/basico_python
0
6632900
def run(): for contador in range(1, 1001): print(contador) # contador si no tiene dos param, empieza en cero, y es mas facil realizar el for con rangos #range es un tipo de dato if __name__ == '__main__': run()
def run(): for contador in range(1, 1001): print(contador) # contador si no tiene dos param, empieza en cero, y es mas facil realizar el for con rangos #range es un tipo de dato if __name__ == '__main__': run()
es
0.816112
# contador si no tiene dos param, empieza en cero, y es mas facil realizar el for con rangos #range es un tipo de dato
3.503028
4
deprecated/dataloaders/deprecated_examples/multimedia/mmimdb_MVAE_mixed.py
kapikantzari/MultiBench
148
6632901
from objective_functions.recon import elbo_loss, sigmloss1dcentercrop from unimodals.MVAE import LeNetEncoder, DeLeNet from training_structures.MVAE_mixed import train_MVAE, test_MVAE from datasets.avmnist.get_data import get_dataloader import torch from torch import nn from unimodals.common_models import MLP from fusi...
from objective_functions.recon import elbo_loss, sigmloss1dcentercrop from unimodals.MVAE import LeNetEncoder, DeLeNet from training_structures.MVAE_mixed import train_MVAE, test_MVAE from datasets.avmnist.get_data import get_dataloader import torch from torch import nn from unimodals.common_models import MLP from fusi...
en
0.336171
# TODO # channels=6 # encoders=[LeNetEncoder(1,channels,3,n_latent).cuda(),LeNetEncoder(1,channels,5,n_latent).cuda()] # decoders=[DeLeNet(1,channels,3,n_latent).cuda(),DeLeNet(1,channels,5,n_latent).cuda()] # head=MLP(n_latent,40,classes).cuda() # elbo=elbo_loss([sigmloss1dcentercrop(28,34),sigmloss1dcentercrop(112,13...
1.871719
2
tests/test_utils.py
CNugteren/keras-onnx
1
6632902
############################################################################### # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. ############################################################################### imp...
############################################################################### # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. ############################################################################### imp...
en
0.470766
############################################################################### # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. ############################################################################### # c...
2.234944
2
h2o-py/tests/testdir_algos/glrm/pyunit_arrests_missing_glrm.py
ahmedengu/h2o-3
6,098
6632903
<reponame>ahmedengu/h2o-3 from __future__ import print_function from builtins import str from builtins import range import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils from h2o.estimators.glrm import H2OGeneralizedLowRankEstimator import numpy as np def glrm_arrests_miss(): missing_...
from __future__ import print_function from builtins import str from builtins import range import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils from h2o.estimators.glrm import H2OGeneralizedLowRankEstimator import numpy as np def glrm_arrests_miss(): missing_ratios = np.arange(0.1, 1,...
en
0.332776
# Check imputed data and error metrics # h2o.remove(arrests_glrm._model_json['output']['loading_key']['name'])
2.393313
2
Advent of Code 2019/aoc_day8_part1.py
markbrown314/toy_problems
0
6632904
<reponame>markbrown314/toy_problems<filename>Advent of Code 2019/aoc_day8_part1.py<gh_stars>0 """ 🎅 --- Day 8: Space Image Format --- The Elves' spirits are lifted when they realize you have an opportunity to reboot one of their Mars rovers, and so they are curious if you would spend a brief sojourn on Mars. You land ...
of Code 2019/aoc_day8_part1.py<gh_stars>0 """ 🎅 --- Day 8: Space Image Format --- The Elves' spirits are lifted when they realize you have an opportunity to reboot one of their Mars rovers, and so they are curious if you would spend a brief sojourn on Mars. You land your ship near the rover. When you reach the rover,...
en
0.931754
🎅 --- Day 8: Space Image Format --- The Elves' spirits are lifted when they realize you have an opportunity to reboot one of their Mars rovers, and so they are curious if you would spend a brief sojourn on Mars. You land your ship near the rover. When you reach the rover, you discover that it's already in the process...
3.982855
4
cubes/server/browser.py
devvmh/cubes
2
6632905
# -*- coding=utf -*- import json import logging from ..logging import get_logger from ..browser import * class SlicerBrowser(AggregationBrowser): """Aggregation browser for Cubes Slicer OLAP server.""" def __init__(self, cube, store, locale=None, **options): """Browser for another Slicer server. ...
# -*- coding=utf -*- import json import logging from ..logging import get_logger from ..browser import * class SlicerBrowser(AggregationBrowser): """Aggregation browser for Cubes Slicer OLAP server.""" def __init__(self, cube, store, locale=None, **options): """Browser for another Slicer server. ...
en
0.849854
# -*- coding=utf -*- Aggregation browser for Cubes Slicer OLAP server. Browser for another Slicer server. # Get the original features as provided by the Slicer server. # They are stored in browser_options in the Slicer model provider's # cube(). # Replace only the actions, as we are not just a simple proxy. Prepare an ...
2.446311
2
diofant/functions/special/beta_functions.py
rajkk1/diofant
57
6632906
from ...core.function import ArgumentIndexError, Function from .gamma_functions import digamma, gamma ############################################################################### # ########################## COMPLETE BETA FUNCTION ######################## # ########################################################...
from ...core.function import ArgumentIndexError, Function from .gamma_functions import digamma, gamma ############################################################################### # ########################## COMPLETE BETA FUNCTION ######################## # ########################################################...
en
0.387844
############################################################################### # ########################## COMPLETE BETA FUNCTION ######################## # ############################################################################### The beta integral is called the Eulerian integral of the first kind by Legen...
2.90986
3
src/models/caec_uniform.py
panpiort8/CatAutoEncoderCompressor
0
6632907
from functools import reduce import bitarray import torch import torch.nn from .caec_base import CAECBase class CAECUniform(CAECBase): def __init__(self, cfg): super().__init__(cfg) self.d = cfg.d self.latent_dim = reduce(lambda x, y: x * y, self.latent) self.mult = torch.tensor(...
from functools import reduce import bitarray import torch import torch.nn from .caec_base import CAECBase class CAECUniform(CAECBase): def __init__(self, cfg): super().__init__(cfg) self.d = cfg.d self.latent_dim = reduce(lambda x, y: x * y, self.latent) self.mult = torch.tensor(...
en
0.748876
# q in [0, 1] # q in [0, 1] # x in [0, 1] # x in [-1, 1]
2.133437
2
utils/dp.py
jakiki6/justastupidgame
2
6632908
import pygame from __main__ import world def get_pos_x(): return (pygame.mouse.get_pos()[0] + world.dx) // 32 def get_pos_y(): return (pygame.mouse.get_pos()[1] + world.dy) // 32 def get_pos_xy(): return (get_pos_x(), get_pos_y()) def get_dp_x(): return world.dx % 32 def get_dp_y(): return world...
import pygame from __main__ import world def get_pos_x(): return (pygame.mouse.get_pos()[0] + world.dx) // 32 def get_pos_y(): return (pygame.mouse.get_pos()[1] + world.dy) // 32 def get_pos_xy(): return (get_pos_x(), get_pos_y()) def get_dp_x(): return world.dx % 32 def get_dp_y(): return world...
none
1
2.889785
3
thoughts.py
apstsh/thoughtsweb
1
6632909
<gh_stars>1-10 from flask import Flask from flask import render_template, request from dbconnect import fetch_thoughts, submit_thoughts_db thoughtsapp = Flask(__name__) @thoughtsapp.route('/thought_for_the_day1') def display_thoughts1(): result = fetch_thoughts() result1 = result[0][0].decode() print(resu...
from flask import Flask from flask import render_template, request from dbconnect import fetch_thoughts, submit_thoughts_db thoughtsapp = Flask(__name__) @thoughtsapp.route('/thought_for_the_day1') def display_thoughts1(): result = fetch_thoughts() result1 = result[0][0].decode() print(result1) return...
none
1
2.652255
3
assignments/assignments_turnitin_msonline_list.py
dgrobani/py3_canvaslmi_api
18
6632910
<reponame>dgrobani/py3_canvaslmi_api # https://canvas.instructure.com/doc/api/assignments.html from datetime import datetime from canvas.core.courses import get_courses, get_courses_whitelisted, get_course_people, get_courses_by_account_id from canvas.core.io import write_xlsx_file, tada from canvas.core.assign...
# https://canvas.instructure.com/doc/api/assignments.html from datetime import datetime from canvas.core.courses import get_courses, get_courses_whitelisted, get_course_people, get_courses_by_account_id from canvas.core.io import write_xlsx_file, tada from canvas.core.assignments import get_assignments def...
en
0.505826
# https://canvas.instructure.com/doc/api/assignments.html # assignments_turnitin_msonline_list()
2.923779
3
src/parsers/lane_2000_general_parser.py
zgordo/openelections-data-or
18
6632911
<filename>src/parsers/lane_2000_general_parser.py #!/usr/bin/python # -*- coding: utf-8 -*- # The MIT License (MIT) # Copyright (c) 2016 <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 Softw...
<filename>src/parsers/lane_2000_general_parser.py #!/usr/bin/python # -*- coding: utf-8 -*- # The MIT License (MIT) # Copyright (c) 2016 <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 Softw...
en
0.727332
#!/usr/bin/python # -*- coding: utf-8 -*- # The MIT License (MIT) # Copyright (c) 2016 <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 limitati...
1.965165
2
ghidra_bridge/ghidra_bridge.py
novafacing/ghidra_bridge
0
6632912
import sys import weakref import pydoc from jfx_bridge import bridge from .server.ghidra_bridge_port import DEFAULT_SERVER_PORT from .server.ghidra_bridge_host import DEFAULT_SERVER_HOST """ Use this list to exclude modules and names loaded by the remote ghidra_bridge side from being loaded into namespaces (they'll ...
import sys import weakref import pydoc from jfx_bridge import bridge from .server.ghidra_bridge_port import DEFAULT_SERVER_PORT from .server.ghidra_bridge_host import DEFAULT_SERVER_HOST """ Use this list to exclude modules and names loaded by the remote ghidra_bridge side from being loaded into namespaces (they'll ...
en
0.818189
Use this list to exclude modules and names loaded by the remote ghidra_bridge side from being loaded into namespaces (they'll still be present in the BridgedObject for the __main__ module. This prevents the ghidra_bridge imported by ghidra_bridge_server being loaded over the local ghidra_bridge and causing issues. Yo...
1.915601
2
map_config/migrate_graph.py
piyushk/utexas_guidance
0
6632913
<reponame>piyushk/utexas_guidance import yaml with open("graph_copy.yaml", 'r') as stream: contents = yaml.load(stream) for vtx in contents: vtx["id"] += 49 for i in range(len(vtx["edges"])): vtx["edges"][i] += 49 vtx["z"] = 15.0 with open("graph_copy2.yaml", 'w') as stream: ...
import yaml with open("graph_copy.yaml", 'r') as stream: contents = yaml.load(stream) for vtx in contents: vtx["id"] += 49 for i in range(len(vtx["edges"])): vtx["edges"][i] += 49 vtx["z"] = 15.0 with open("graph_copy2.yaml", 'w') as stream: ...
none
1
2.344363
2
tests/app/db.py
tlwr/notifications-api
0
6632914
<reponame>tlwr/notifications-api import random import uuid from datetime import datetime, date, timedelta from app import db from app.dao.email_branding_dao import dao_create_email_branding from app.dao.inbound_sms_dao import dao_create_inbound_sms from app.dao.invited_org_user_dao import save_invited_org_user from ap...
import random import uuid from datetime import datetime, date, timedelta from app import db from app.dao.email_branding_dao import dao_create_email_branding from app.dao.inbound_sms_dao import dao_create_inbound_sms from app.dao.invited_org_user_dao import save_invited_org_user from app.dao.invited_user_dao import sav...
en
0.579506
# we did not specify in test - lets create it # create random inbound number # noqa https://docs.aws.amazon.com/ses/latest/DeveloperGuide/notification-contents.html#complaint-object # noqa https://docs.aws.amazon.com/ses/latest/DeveloperGuide/notification-contents.html#complaint-object # noqa
1.255212
1
tests/test_change_speed.py
sedv8808/AudioFilters_py
2
6632915
import numpy as np import pytest from audiofilters.change_speed import change_speed input_signal = np.genfromtxt('tests/data/bark.csv', dtype = 'float32') ''' Test that exception is raised for unsupported input_signal argument type. ''' def test_unsupported_input_signal_type_raises_error(): with pytest.raises(Exc...
import numpy as np import pytest from audiofilters.change_speed import change_speed input_signal = np.genfromtxt('tests/data/bark.csv', dtype = 'float32') ''' Test that exception is raised for unsupported input_signal argument type. ''' def test_unsupported_input_signal_type_raises_error(): with pytest.raises(Exc...
en
0.858531
Test that exception is raised for unsupported input_signal argument type. Test that exception is raised for negative rate argument Test that exception is raised for rate argument equal to zero Make sure the output matches example data when speed is increased # Mean squared error between input and output signal Make sur...
2.908185
3
vegaapiclient/generated/vega/checkpoint/v1/__init__.py
vegaprotocol/sdk-python
1
6632916
from . import checkpoint_pb2_grpc as checkpoint_grpc from . import checkpoint_pb2 as checkpoint __all__ = [ "checkpoint_grpc", "checkpoint", ]
from . import checkpoint_pb2_grpc as checkpoint_grpc from . import checkpoint_pb2 as checkpoint __all__ = [ "checkpoint_grpc", "checkpoint", ]
none
1
1.040267
1
app/models/modifier.py
marcusosso/uwhvz
9
6632917
<filename>app/models/modifier.py import uuid from datetime import datetime from django.db import models from enumfields import Enum, EnumField from .faction import Faction class ModifierType(Enum): ONE_TIME_USE = 'O' SUPPLY_CODE = 'S' TAG = 'T' class Modifier(models.Model): id: uuid = models.UUIDF...
<filename>app/models/modifier.py import uuid from datetime import datetime from django.db import models from enumfields import Enum, EnumField from .faction import Faction class ModifierType(Enum): ONE_TIME_USE = 'O' SUPPLY_CODE = 'S' TAG = 'T' class Modifier(models.Model): id: uuid = models.UUIDF...
none
1
2.17703
2
themis/__init__.py
celskeggs/themis
1
6632918
<gh_stars>1-10 import themis.channel import themis.frc import themis.joystick import themis.drive from themis.channel import *
import themis.channel import themis.frc import themis.joystick import themis.drive from themis.channel import *
none
1
1.036824
1
extract/moor/job_lists.py
parkermac/LO_user
0
6632919
<reponame>parkermac/LO_user """ Module to create dicts for multiple (or single) mooring extractions. """ def get_sta_dict(job_name): # specific job definitions if job_name == 'willapa_bc': # Willapa Bay Center PCSGA Mooring sta_dict = { 'wbc': (-123.9516, 46.6290) } ...
""" Module to create dicts for multiple (or single) mooring extractions. """ def get_sta_dict(job_name): # specific job definitions if job_name == 'willapa_bc': # Willapa Bay Center PCSGA Mooring sta_dict = { 'wbc': (-123.9516, 46.6290) } elif job_name...
en
0.833967
Module to create dicts for multiple (or single) mooring extractions. # specific job definitions # Willapa Bay Center PCSGA Mooring # note I pushed two of the locations a bit West to get off the landmask
2.772697
3
pages/themes/PyQT-Lecture1/Tasks_and_HW/Solution_PyQT_HW_1_My_First_GUI/Ui_my_first_GUI.py
WWWCourses/PythonCourseNetIT-Slides
0
6632920
<reponame>WWWCourses/PythonCourseNetIT-Slides<gh_stars>0 # -*- coding: utf-8 -*- # Form implementation generated from reading ui file '/home/nemsys/projects/courses/netIT/PythonCourseNetIT/PythonCourse307-Labs/lab44/HW/my_first_GUI.ui' # # Created by: PyQt5 UI code generator 5.15.4 # # WARNING: Any manual changes made...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '/home/nemsys/projects/courses/netIT/PythonCourseNetIT/PythonCourse307-Labs/lab44/HW/my_first_GUI.ui' # # Created by: PyQt5 UI code generator 5.15.4 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. D...
en
0.772911
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '/home/nemsys/projects/courses/netIT/PythonCourseNetIT/PythonCourse307-Labs/lab44/HW/my_first_GUI.ui' # # Created by: PyQt5 UI code generator 5.15.4 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do...
2.478045
2
collectfast/storage_extensions/s3boto.py
jpnauta/collectfast
0
6632921
from storages.utils import safe_join from collectfast.storage_extensions.base import BaseStorageExtensions, check_preload_metadata class S3BotoStorageExtensions(BaseStorageExtensions): """ Storage extensions for django-storage's `S3BotoStorage` """ def __init__(self, storage): super(S3BotoSt...
from storages.utils import safe_join from collectfast.storage_extensions.base import BaseStorageExtensions, check_preload_metadata class S3BotoStorageExtensions(BaseStorageExtensions): """ Storage extensions for django-storage's `S3BotoStorage` """ def __init__(self, storage): super(S3BotoSt...
en
0.537756
Storage extensions for django-storage's `S3BotoStorage`
1.89642
2
ambari-server/src/main/resources/stacks/HDP/1.3.2/services/MAPREDUCE/package/scripts/params.py
wbear2/ambari
5
6632922
""" Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
""" Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
en
0.834741
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file...
1.149215
1
setup.py
youngsm/adsgrb
0
6632923
#!/usr/bin/env python """The setup script.""" import os import re import sys from functools import reduce from setuptools import find_packages from setuptools import setup with open("README.rst") as readme_file: readme = readme_file.read() # with open("./requirements.txt") as requirements_file: # requirement...
#!/usr/bin/env python """The setup script.""" import os import re import sys from functools import reduce from setuptools import find_packages from setuptools import setup with open("README.rst") as readme_file: readme = readme_file.read() # with open("./requirements.txt") as requirements_file: # requirement...
en
0.726226
#!/usr/bin/env python The setup script. # with open("./requirements.txt") as requirements_file: # requirements = requirements_file.read().splitlines() # Thank you <NAME> for this nice versioning method
1.86507
2
src/syft/ast/callable.py
dnabanita7/PySyft
1
6632924
<gh_stars>1-10 # stdlib from types import ModuleType from typing import Any from typing import Callable as CallableT from typing import List from typing import Optional from typing import Tuple from typing import Union # syft relative from .. import ast from .. import lib from ..core.node.abstract.node import Abstract...
# stdlib from types import ModuleType from typing import Any from typing import Callable as CallableT from typing import List from typing import Optional from typing import Tuple from typing import Union # syft relative from .. import ast from .. import lib from ..core.node.abstract.node import AbstractNodeClient from...
en
0.843668
# stdlib # syft relative Represent a method (can be static), global function, or constructor which can be directly executed. Args: path_and_name: The path for the current node, e.g. `syft.lib.python.List`. object_ref: The actual python object for which the computation is being made. ...
2.249453
2
yourcar/car/migrations/0001_initial.py
italopaiva/your.car
0
6632925
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-06-06 02:47 from __future__ import unicode_literals import django.core.validators from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operation...
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-06-06 02:47 from __future__ import unicode_literals import django.core.validators from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operation...
en
0.833257
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-06-06 02:47
1.972026
2
sources/gamestage03.py
kantel/turtlepy
0
6632926
import turtle as t import random as r import math import os WIDTH = 600 HEIGHT = 600 NUMGOALS = 6 NUMALIENS = 4 class Sprite(t.Turtle): def __init__(self, tshape, tcolor): t.Turtle.__init__(self) self.penup() self.speed(0) self.shape(tshape) self.color(tcolor) ...
import turtle as t import random as r import math import os WIDTH = 600 HEIGHT = 600 NUMGOALS = 6 NUMALIENS = 4 class Sprite(t.Turtle): def __init__(self, tshape, tcolor): t.Turtle.__init__(self) self.penup() self.speed(0) self.shape(tshape) self.color(tcolor) ...
de
0.987292
# Ränder checken und ausweichen # Geschwindigkeitsbegrenzug # Geschwindigkeitsbegrenzung # Default-Vorbelegung, wird bei der Initialisierung überschrieben # Default-Vorbelegung, wird bei der Initialisierung überschrieben # Die Grenzen des Spielfeldes zeichnen # Die Zielobjekte erzeugen # Die Aliens erzeugen # Auf Tasta...
3.689547
4
HotBlog/HotBlog.py
gavinfish/awesome-python
7
6632927
<filename>HotBlog/HotBlog.py import urllib.request as ul import re from bs4 import BeautifulSoup import time import random class HotBlog(object): url_pattern = "http://www.baidu.com/s?ie=utf-8&pn={pn}&wd={wd}" headers = { 'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.6) Gecko...
<filename>HotBlog/HotBlog.py import urllib.request as ul import re from bs4 import BeautifulSoup import time import random class HotBlog(object): url_pattern = "http://www.baidu.com/s?ie=utf-8&pn={pn}&wd={wd}" headers = { 'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.6) Gecko...
none
1
2.948788
3
MAPS/sample_stats_constrained.py
gmooers96/CBRAIN-CAM
0
6632928
<filename>MAPS/sample_stats_constrained.py import argparse import json import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as ticker import keras from keras import layers from keras import backend as K import tensorflow as tf from sklearn.preprocessing import StandardScaler from sklearn.de...
<filename>MAPS/sample_stats_constrained.py import argparse import json import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as ticker import keras from keras import layers from keras import backend as K import tensorflow as tf from sklearn.preprocessing import StandardScaler from sklearn.de...
en
0.475202
TODO # Sample reconstruction based on predicted mean and variance # recon_sample = np.random.multivariate_normal(sample_mean, np.exp(sample_log_var) * np.identity(128*30)) # Rescale original sample and reconstruction to original scale # Get min and max of original and reconstructed # Reshape reconstructed sample #print...
2.074388
2
scripts/install/win/OpenKinect/freenect-examples/setup.py
ffsouza/SimpleCV
2
6632929
#!/usr/bin/env python from distutils.core import setup from distutils.extension import Extension import re def get_cython_version(): """ Returns: Version as a pair of ints (major, minor) Raises: ImportError: Can't load cython or find version """ import Cython.Compile...
#!/usr/bin/env python from distutils.core import setup from distutils.extension import Extension import re def get_cython_version(): """ Returns: Version as a pair of ints (major, minor) Raises: ImportError: Can't load cython or find version """ import Cython.Compile...
en
0.630395
#!/usr/bin/env python Returns: Version as a pair of ints (major, minor) Raises: ImportError: Can't load cython or find version # Only use Cython if it is available, else just use the pre-generated files # Requires Cython version 0.13 and up #'C:/Users/kscottz/Desktop/kinect/Pre-built.2/lib', # ...
2.141176
2
Concurrency/codeSample/Part11_Alternatives_to_Threads_and_Processes/generator.py
Chyi341152/pyConPaper
1
6632930
<gh_stars>1-10 #!/usr/bin/env python3 # -*- coding:utf-8 -*- # generator.py # A very simple example of using generators to implement a form of cooperative multitasking def countdown_task(n): while n > 0: print(n) yield n -= 1 # A list of tasks to run from collections import deque # lis...
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # generator.py # A very simple example of using generators to implement a form of cooperative multitasking def countdown_task(n): while n > 0: print(n) yield n -= 1 # A list of tasks to run from collections import deque # list-like containe...
en
0.744852
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # generator.py # A very simple example of using generators to implement a form of cooperative multitasking # A list of tasks to run # list-like container with fast appends and pops on either end # Each task is a generator function # Run to the next yield # Reschedule # Run...
4.152406
4
backend_django/posts/migrations/0015_postrating.py
Neo1277/blogDjangoAndReact
0
6632931
# Generated by Django 3.1 on 2021-05-22 15:14 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('posts', '0014_auto_2021010...
# Generated by Django 3.1 on 2021-05-22 15:14 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('posts', '0014_auto_2021010...
en
0.830103
# Generated by Django 3.1 on 2021-05-22 15:14
1.793839
2
dexp/processing/color/crop_resize_pad.py
haesleinhuepf/dexp
16
6632932
<reponame>haesleinhuepf/dexp<filename>dexp/processing/color/crop_resize_pad.py from typing import Tuple, Union from dexp.utils import xpArray from dexp.utils.backends import Backend def crop_resize_pad_color_image( image: xpArray, crop: Union[int, Tuple[int, ...], Tuple[Tuple[int, int], ...]] = None, res...
from typing import Tuple, Union from dexp.utils import xpArray from dexp.utils.backends import Backend def crop_resize_pad_color_image( image: xpArray, crop: Union[int, Tuple[int, ...], Tuple[Tuple[int, int], ...]] = None, resize: Tuple[int, ...] = None, resize_order: int = 3, resize_mode: str = ...
en
0.757597
Crops, resizes and then pad an RGB(A) image. Parameters ---------- image: image to resize. crop: Crop image by removing a given number of pixels/voxels per axis. For example: ((10,20),(10,20)) crops 10 pixels on the left for axis 0, 20 pixels from the right of axis 0, and the same for axis 2. ...
2.955824
3
src/Interpreter/frame.py
Sword-And-Rose/Simple-Interpreter
1
6632933
from Semantic.symbol import * import logging class Frame(object): def __init__(self, scope, enclosing_frame=None): self.scope = scope self.data = {} self.enclosing_frame = enclosing_frame self.return_value = None def set(self, name, value): if name == self.scope.scope_...
from Semantic.symbol import * import logging class Frame(object): def __init__(self, scope, enclosing_frame=None): self.scope = scope self.data = {} self.enclosing_frame = enclosing_frame self.return_value = None def set(self, name, value): if name == self.scope.scope_...
none
1
2.723328
3
tests/integration-tests/tests/ad_integration/cluster_user.py
enrico-usai/cfncluster
0
6632934
import logging import os from assertpy import assert_that from paramiko import AutoAddPolicy, SSHClient from remote_command_executor import RemoteCommandExecutor from utils import run_command class ClusterUser: """Class to represent a cluster user in a multi-user environment.""" def __init__( self, ...
import logging import os from assertpy import assert_that from paramiko import AutoAddPolicy, SSHClient from remote_command_executor import RemoteCommandExecutor from utils import run_command class ClusterUser: """Class to represent a cluster user in a multi-user environment.""" def __init__( self, ...
en
0.891967
Class to represent a cluster user in a multi-user environment. # TODO: don't need to keep this? # TODO: randomly generate this. It's hardcoded here because it's also hard-coded in the script # that creates users as part of the directory stack. Create an RSA SSH keypair for the user. Copy user's public SSH key to ...
2.522488
3
beast/physicsmodel/tests/test_stellar_prior_weights.py
cmurray-astro/beast
0
6632935
import numpy as np from beast.physicsmodel.prior_weights_stars import ( compute_distance_prior_weights, compute_age_prior_weights, compute_mass_prior_weights, compute_metallicity_prior_weights, imf_kroupa, ) def test_flat_age_prior_weights(): """ Test for flat age prior """ log_ag...
import numpy as np from beast.physicsmodel.prior_weights_stars import ( compute_distance_prior_weights, compute_age_prior_weights, compute_mass_prior_weights, compute_metallicity_prior_weights, imf_kroupa, ) def test_flat_age_prior_weights(): """ Test for flat age prior """ log_ag...
en
0.716171
Test for flat age prior Test for flat log age prior Test for bin histogram age prior Test for bin interpolation age prior Test for exponential age prior with a tau = 0.1 Test for creating kroupa IMF Test the kroupa mass prior Test the salpeter mass prior Test the flat mass prior Test the flat metallicity prior Test the...
2.353952
2
scan.py
tmwctw/nclpokemap
139
6632936
#!/usr/bin/env python3 import monocle.sanitized as conf from asyncio import gather, set_event_loop_policy, Task, wait_for, TimeoutError try: if conf.UVLOOP: from uvloop import EventLoopPolicy set_event_loop_policy(EventLoopPolicy()) except ImportError: pass from multiprocessing.managers impor...
#!/usr/bin/env python3 import monocle.sanitized as conf from asyncio import gather, set_event_loop_policy, Task, wait_for, TimeoutError try: if conf.UVLOOP: from uvloop import EventLoopPolicy set_event_loop_policy(EventLoopPolicy()) except ImportError: pass from multiprocessing.managers impor...
en
0.895674
#!/usr/bin/env python3 Block until queue size falls below maxsize # Spaces at the end are important, as they clear previously printed # output - \r doesn't clean whole line
2.003925
2
google/monitoring/v3/monitoring-v3-py/google/cloud/monitoring_v3/types/common.py
googleapis/googleapis-gen
7
6632937
# -*- 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...
# -*- 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...
en
0.841408
# -*- 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.644666
2
inclearn/lib/network/calibrators.py
Zotkin/incremental_learning.pytorch
277
6632938
import torch from torch import nn class CalibrationWrapper(nn.Module): """Wraps several calibration models, each being applied on different targets.""" def __init__(self): super().__init__() self.start_indexes = [] self.end_indexes = [] self.models = nn.ModuleList([]) de...
import torch from torch import nn class CalibrationWrapper(nn.Module): """Wraps several calibration models, each being applied on different targets.""" def __init__(self): super().__init__() self.start_indexes = [] self.end_indexes = [] self.models = nn.ModuleList([]) de...
en
0.842926
Wraps several calibration models, each being applied on different targets. Adds a calibration model that will applies on target between the two indexes. The models must be added in the right targets order! Linear model applying on the logits alpha * x + beta. By default, this model is initialized as an id...
2.832772
3
heat/engine/resources/openstack/manila/share.py
soma-micro-service/heat
0
6632939
# # 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, software # di...
# # 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, software # di...
en
0.888773
# # 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, software # di...
1.925583
2
squeaknode/node/squeak_controller.py
gitter-badger/squeaknode
0
6632940
<filename>squeaknode/node/squeak_controller.py<gh_stars>0 # MIT License # # Copyright (c) 2020 <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 ...
<filename>squeaknode/node/squeak_controller.py<gh_stars>0 # MIT License # # Copyright (c) 2020 <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 ...
en
0.745344
# MIT License # # Copyright (c) 2020 <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.410707
1
weatherfood/application.py
leeb24/CS411-s18
0
6632941
<reponame>leeb24/CS411-s18 import flask import flask_bootstrap import flask_oauth2_login app = flask.Flask(__name__) app.config.from_object('config') flask_bootstrap.Bootstrap(app) google_login = flask_oauth2_login.GoogleLogin(app)
import flask import flask_bootstrap import flask_oauth2_login app = flask.Flask(__name__) app.config.from_object('config') flask_bootstrap.Bootstrap(app) google_login = flask_oauth2_login.GoogleLogin(app)
none
1
1.926366
2
dials/models.py
daonb/Open-Knesset
69
6632942
from django.db import models class Dial(models.Model): precent = models.IntegerField(default=0) slug = models.SlugField(max_length=1000) description = models.TextField(null=True, blank=True) updated = models.DateTimeField(auto_now=True)
from django.db import models class Dial(models.Model): precent = models.IntegerField(default=0) slug = models.SlugField(max_length=1000) description = models.TextField(null=True, blank=True) updated = models.DateTimeField(auto_now=True)
none
1
2.120676
2
SystemTests/bin/das_logfile_parser.py
vkuznet/DBS
8
6632943
<filename>SystemTests/bin/das_logfile_parser.py #!/usr/bin/env python from __future__ import print_function from optparse import OptionParser import json, os, re, sys def get_command_line_options(executable_name, arguments): parser = OptionParser(usage="%s options" % executable_name) parser.add_option("-i", "-...
<filename>SystemTests/bin/das_logfile_parser.py #!/usr/bin/env python from __future__ import print_function from optparse import OptionParser import json, os, re, sys def get_command_line_options(executable_name, arguments): parser = OptionParser(usage="%s options" % executable_name) parser.add_option("-i", "-...
en
0.570474
#!/usr/bin/env python You need to provide following options, --in=input.txt (mandatory), --out=output.json (optional)\n ### using regular expressions from http://www.seehuhn.de/blog/52 by <NAME> (Creative Common License) # host %h # indent %l (unused) # user %u # time %t # request "%r" # status %>s # size %b (careful, ...
2.618254
3
Homework_4/D_Keyboard/D_Keyboard.py
dimk00z/summer_yandex_algorithmic_course
8
6632944
with open('input.txt') as file: lines = file.readlines() keyboard_buttons = int(lines[0]) buttons = {str(button_position+1): int(presses) for button_position, presses in enumerate(lines[1].split())} presses_number = int(lines[2]) for press in lines[3].split(): buttons[press] -= 1 result = [] for butt...
with open('input.txt') as file: lines = file.readlines() keyboard_buttons = int(lines[0]) buttons = {str(button_position+1): int(presses) for button_position, presses in enumerate(lines[1].split())} presses_number = int(lines[2]) for press in lines[3].split(): buttons[press] -= 1 result = [] for butt...
none
1
3.33559
3
edl/records.py
jmeppley/py-metagenomics
7
6632945
from edl.util import parse_list_to_set def recordIterator(stream, separatorRE, idRE=None): """ Given: na file-like object (any iterator over strings) 1 or 2 regular expressions that define record boundaries and identifiers Return: an iterator over records that returns a tuple o...
from edl.util import parse_list_to_set def recordIterator(stream, separatorRE, idRE=None): """ Given: na file-like object (any iterator over strings) 1 or 2 regular expressions that define record boundaries and identifiers Return: an iterator over records that returns a tuple o...
en
0.789396
Given: na file-like object (any iterator over strings) 1 or 2 regular expressions that define record boundaries and identifiers Return: an iterator over records that returns a tuple of (id, [recordLines]) If only a separator given, it is assumed to match the record id # is there a pr...
3.559791
4
strawberry/schema/types/scalar.py
matEhickey/strawberry
0
6632946
import datetime import decimal from typing import Dict, Type, cast from uuid import UUID from graphql import ( GraphQLBoolean, GraphQLFloat, GraphQLID, GraphQLInt, GraphQLScalarType, GraphQLString, ) from strawberry.custom_scalar import SCALAR_REGISTRY, ScalarDefinition from strawberry.file_upl...
import datetime import decimal from typing import Dict, Type, cast from uuid import UUID from graphql import ( GraphQLBoolean, GraphQLFloat, GraphQLID, GraphQLInt, GraphQLScalarType, GraphQLString, ) from strawberry.custom_scalar import SCALAR_REGISTRY, ScalarDefinition from strawberry.file_upl...
none
1
2.141537
2
bin/analysis/ipa/model/object.py
ncbray/pystream
6
6632947
<gh_stars>1-10 # Copyright 2011 <NAME> # # 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 2011 <NAME> # # 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, softw...
en
0.846806
# Copyright 2011 <NAME> # # 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, softw...
1.805449
2
python/ray/util/collective/collective_group/nccl_collective_group.py
coreylowman/ray
1
6632948
import logging import datetime import time import ray import cupy from ray.util.collective.collective_group import nccl_util from ray.util.collective.collective_group.base_collective_group \ import BaseGroup from ray.util.collective.types import AllReduceOptions, \ BarrierOptions, Backend, ReduceOptions, Broa...
import logging import datetime import time import ray import cupy from ray.util.collective.collective_group import nccl_util from ray.util.collective.collective_group.base_collective_group \ import BaseGroup from ray.util.collective.types import AllReduceOptions, \ BarrierOptions, Backend, ReduceOptions, Broa...
en
0.787372
# TODO(Hao): # (1) stream management, instead of using the default stream, # using a dedicate stream # (2) communicator management and support num_gpus > 2 per actor. A rendezvous class for different actor/task processes to meet. To initialize an NCCL collective communication group, different actors/tasks ...
2.350681
2
235.py
nanahyunpark/python_study
0
6632949
<gh_stars>0 def div_ans(num, level): if(num == 1): print(level) return if(num%2 == 0): num = num//2 div_ans(num, level+1) elif(num%2 == 1): num = num//3 div_ans(num, level+1) def main(): num = int(input()) div_ans(num, 0) if(__name__ == '__main__'): ...
def div_ans(num, level): if(num == 1): print(level) return if(num%2 == 0): num = num//2 div_ans(num, level+1) elif(num%2 == 1): num = num//3 div_ans(num, level+1) def main(): num = int(input()) div_ans(num, 0) if(__name__ == '__main__'): main()
none
1
3.850352
4
fatiando/mesher/tests/__init__.py
XuesongDing/fatiando
179
6632950
<reponame>XuesongDing/fatiando<filename>fatiando/mesher/tests/__init__.py<gh_stars>100-1000 """ Tests for the fatiando.mesher package. """
""" Tests for the fatiando.mesher package. """
en
0.585076
Tests for the fatiando.mesher package.
1.001592
1