hexsha stringlengths 40 40 | size int64 5 2.06M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 248 | max_stars_repo_name stringlengths 5 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 248 | max_issues_repo_name stringlengths 5 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 248 | max_forks_repo_name stringlengths 5 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 5 2.06M | avg_line_length float64 1 1.02M | max_line_length int64 3 1.03M | alphanum_fraction float64 0 1 | count_classes int64 0 1.6M | score_classes float64 0 1 | count_generators int64 0 651k | score_generators float64 0 1 | count_decorators int64 0 990k | score_decorators float64 0 1 | count_async_functions int64 0 235k | score_async_functions float64 0 1 | count_documentation int64 0 1.04M | score_documentation float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fb8b63ad2ffbee810610ac48848eca279fdeb691 | 47 | py | Python | primeiro programa/primeiro_programa.py | Cesario115/Ola-mundo | 2949ff2c9dc1b5f8bc70825072751b19920019af | [
"MIT"
] | null | null | null | primeiro programa/primeiro_programa.py | Cesario115/Ola-mundo | 2949ff2c9dc1b5f8bc70825072751b19920019af | [
"MIT"
] | null | null | null | primeiro programa/primeiro_programa.py | Cesario115/Ola-mundo | 2949ff2c9dc1b5f8bc70825072751b19920019af | [
"MIT"
] | null | null | null | print('='*50)
print("Olá mundo!")
print('='*50) | 15.666667 | 19 | 0.574468 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 19 | 0.395833 |
fb8c8cf1deb8bca5c92c0e2fc8aa8a95783848a5 | 6,922 | py | Python | src/third_party/swiftshader/third_party/subzero/pydir/wasm-run-torture-tests.py | rhencke/engine | 1016db292c4e73374a0a11536b18303c9522a224 | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | src/third_party/swiftshader/third_party/subzero/pydir/wasm-run-torture-tests.py | rhencke/engine | 1016db292c4e73374a0a11536b18303c9522a224 | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | src/third_party/swiftshader/third_party/subzero/pydir/wasm-run-torture-tests.py | rhencke/engine | 1016db292c4e73374a0a11536b18303c9522a224 | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | #!/usr/bin/env python2
#===- subzero/wasm-run-torture-tests.py - Subzero WASM Torture Test Driver ===//
#
# The Subzero Code Generator
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===-----------------------------------------... | 30.095652 | 80 | 0.647501 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,998 | 0.577579 |
fb8c8d25a3c49500542e0cea8201311268f861d1 | 4,455 | py | Python | game_vs_ai.py | fernandojosuece/Minimax_AI_connect4 | e0110b7d3d25494b7e950c078eacd1337ee14f17 | [
"MIT"
] | null | null | null | game_vs_ai.py | fernandojosuece/Minimax_AI_connect4 | e0110b7d3d25494b7e950c078eacd1337ee14f17 | [
"MIT"
] | null | null | null | game_vs_ai.py | fernandojosuece/Minimax_AI_connect4 | e0110b7d3d25494b7e950c078eacd1337ee14f17 | [
"MIT"
] | null | null | null | import numpy as np
import pygame
import sys
import math
import random
from board import Board
from ai import Minimax_AI
# function to draw the board in pygame
def draw_board(board):
for c in range(COLUMN_COUNT):
for r in range(ROW_COUNT):
pygame.draw.rect(screen, colors["blue"], (c*SQUARESIZE,... | 32.05036 | 101 | 0.489787 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 352 | 0.079012 |
fb8cf968314b4148ab23bd50a8ea481955bbd517 | 963 | py | Python | {{cookiecutter.project_slug}}/sources/app/config/settings/components/security.py | AsheKR/cookiecutter-django | d0402aefcc2eeaffa747faa7ef50ad97286bfcca | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.project_slug}}/sources/app/config/settings/components/security.py | AsheKR/cookiecutter-django | d0402aefcc2eeaffa747faa7ef50ad97286bfcca | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.project_slug}}/sources/app/config/settings/components/security.py | AsheKR/cookiecutter-django | d0402aefcc2eeaffa747faa7ef50ad97286bfcca | [
"BSD-3-Clause"
] | null | null | null | # https://docs.djangoproject.com/en/dev/ref/settings/#secure-proxy-ssl-header
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
# https://docs.djangoproject.com/en/dev/ref/settings/#secure-ssl-redirect
SECURE_SSL_REDIRECT = True
# https://docs.djangoproject.com/en/dev/ref/settings/#session-cookie-secure
SES... | 53.5 | 86 | 0.805815 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 710 | 0.737279 |
fb8cffb83eb9a76e5f50b56af16a0174fdb1dc32 | 12,118 | py | Python | dabest/bootstrap_tools.py | nitishkumarmishra/DABEST | 82490f587e9b0180f29baa2daf44aa86cc3f52aa | [
"BSD-3-Clause-Clear"
] | null | null | null | dabest/bootstrap_tools.py | nitishkumarmishra/DABEST | 82490f587e9b0180f29baa2daf44aa86cc3f52aa | [
"BSD-3-Clause-Clear"
] | null | null | null | dabest/bootstrap_tools.py | nitishkumarmishra/DABEST | 82490f587e9b0180f29baa2daf44aa86cc3f52aa | [
"BSD-3-Clause-Clear"
] | null | null | null | #!/usr/bin/python
# -*-coding: utf-8 -*-
# Author: Joses Ho
# Email : [email protected]
from __future__ import division
class bootstrap:
'''Computes the summary statistic and a bootstrapped confidence interval.
Keywords:
x1, x2: array-like
The data in a one-dimensional array form. Onl... | 36.173134 | 104 | 0.605793 | 10,124 | 0.835451 | 0 | 0 | 0 | 0 | 0 | 0 | 6,180 | 0.509985 |
fb8db21fcb68449e4d69cc6ce7881b29676db85c | 864 | py | Python | Numbers/floor_tiles_cost.py | lucasc896/Projects | 01ec687b07e4b56554c89ecc244fe5979c489826 | [
"MIT"
] | null | null | null | Numbers/floor_tiles_cost.py | lucasc896/Projects | 01ec687b07e4b56554c89ecc244fe5979c489826 | [
"MIT"
] | null | null | null | Numbers/floor_tiles_cost.py | lucasc896/Projects | 01ec687b07e4b56554c89ecc244fe5979c489826 | [
"MIT"
] | null | null | null | import math as ma
# note all sizes in m^2
# all costs in pounds
def get_details():
return {'w': get_value("Width:", float),
'h': get_value("Height:", float),
'cost': get_value("Cost per tile:", float),}
def get_value(text = "enter_val", expected_type = None):
while True:
r_i... | 23.351351 | 81 | 0.572917 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 260 | 0.300926 |
fb8ef4de168793f84748b01a69155748193991bb | 2,579 | py | Python | pyflow/demo/cwdDemo/cwdDemo.py | quejebo/pyflow | 99718942f9ea4ac0ceacde17c8006068ef19f2c8 | [
"BSD-2-Clause"
] | 3 | 2019-05-29T23:01:51.000Z | 2020-02-20T21:36:55.000Z | pyflow/demo/cwdDemo/cwdDemo.py | quejebo/pyflow | 99718942f9ea4ac0ceacde17c8006068ef19f2c8 | [
"BSD-2-Clause"
] | null | null | null | pyflow/demo/cwdDemo/cwdDemo.py | quejebo/pyflow | 99718942f9ea4ac0ceacde17c8006068ef19f2c8 | [
"BSD-2-Clause"
] | 2 | 2020-10-31T00:49:40.000Z | 2021-04-28T18:56:40.000Z | #!/usr/bin/env python
#
# pyFlow - a lightweight parallel task engine
#
# Copyright (c) 2012-2017 Illumina, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source ... | 29.643678 | 92 | 0.711904 | 698 | 0.270648 | 0 | 0 | 0 | 0 | 0 | 0 | 1,969 | 0.763474 |
fb90339a9b070648b3ffa1426d143af98658172e | 345 | py | Python | cc/apps/coder/admin.py | mavroskardia/codechallenge | a5fee4ba73be186d90daafca50819a6817ad3d27 | [
"MIT"
] | null | null | null | cc/apps/coder/admin.py | mavroskardia/codechallenge | a5fee4ba73be186d90daafca50819a6817ad3d27 | [
"MIT"
] | null | null | null | cc/apps/coder/admin.py | mavroskardia/codechallenge | a5fee4ba73be186d90daafca50819a6817ad3d27 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Coder, Level
class CoderAdmin(admin.ModelAdmin):
pass
class LevelAdmin(admin.ModelAdmin):
list_display_links = ('id',)
list_display = ('id', 'name', 'starting_xp')
list_editable = ('name', 'starting_xp')
admin.site.register(Coder, CoderAdmin)
admin.site.reg... | 20.294118 | 45 | 0.750725 | 193 | 0.55942 | 0 | 0 | 0 | 0 | 0 | 0 | 46 | 0.133333 |
fb906bc559344cfcb6abb67edb4b96c49dafc738 | 4,423 | py | Python | src/py/env.py | timgates42/lithp | 607d20fe18ca0a2af026c12d223bb802746fe7e7 | [
"MIT"
] | 76 | 2015-01-10T08:16:15.000Z | 2022-02-18T05:22:29.000Z | mi/env.py | mountain/mu | 9834a5aea2ade8ad4462fa959d2d00c129335b7c | [
"MIT"
] | null | null | null | mi/env.py | mountain/mu | 9834a5aea2ade8ad4462fa959d2d00c129335b7c | [
"MIT"
] | 14 | 2015-01-11T17:07:10.000Z | 2021-07-25T00:23:59.000Z | # The `Environment` class represents the dynamic environment of McCarthy's original Lisp. The creation of
# this class is actually an interesting story. As many of you probably know, [Paul Graham wrote a paper and
# code for McCarthy's original Lisp](http://www.paulgraham.com/rootsoflisp.html) and it was my first e... | 42.941748 | 141 | 0.640968 | 2,423 | 0.547818 | 0 | 0 | 0 | 0 | 0 | 0 | 3,111 | 0.703369 |
fb90bddf16d6e083178b78c9099cb96b4aea6048 | 4,416 | py | Python | tests/storage/test_filesystem.py | dilyanpalauzov/vdirsyncer | a3cf8e67f6396c91172b34896b828a0293ecf3c5 | [
"BSD-3-Clause"
] | 888 | 2016-03-16T12:03:14.000Z | 2022-03-28T17:45:44.000Z | tests/storage/test_filesystem.py | dilyanpalauzov/vdirsyncer | a3cf8e67f6396c91172b34896b828a0293ecf3c5 | [
"BSD-3-Clause"
] | 499 | 2016-03-15T14:18:47.000Z | 2022-03-30T02:12:40.000Z | tests/storage/test_filesystem.py | dilyanpalauzov/vdirsyncer | a3cf8e67f6396c91172b34896b828a0293ecf3c5 | [
"BSD-3-Clause"
] | 135 | 2016-03-25T12:50:14.000Z | 2022-03-25T00:28:59.000Z | import subprocess
import aiostream
import pytest
from vdirsyncer.storage.filesystem import FilesystemStorage
from vdirsyncer.vobject import Item
from . import StorageTests
class TestFilesystemStorage(StorageTests):
storage_class = FilesystemStorage
@pytest.fixture
def get_storage_args(self, tmpdir):
... | 33.969231 | 83 | 0.619339 | 4,245 | 0.959756 | 0 | 0 | 3,898 | 0.881302 | 3,587 | 0.810988 | 567 | 0.128194 |
fb910124233c9edcba63460a96cd8cc70f5f9da6 | 1,635 | py | Python | covid_sicilia.py | Cip0/covid-ita-graph | cb788b845940168ce45abbd6203f464bfe91ea46 | [
"CC0-1.0"
] | null | null | null | covid_sicilia.py | Cip0/covid-ita-graph | cb788b845940168ce45abbd6203f464bfe91ea46 | [
"CC0-1.0"
] | null | null | null | covid_sicilia.py | Cip0/covid-ita-graph | cb788b845940168ce45abbd6203f464bfe91ea46 | [
"CC0-1.0"
] | null | null | null | import pandas as pd
from datetime import timedelta, date
import matplotlib.pyplot as plt
def daterange(start_date, end_date):
for n in range(int((end_date - start_date).days)):
yield start_date + timedelta(n)
def getFileByDate(date = 'latest'):
url = 'https://raw.githubusercontent.com/pcm-dpc/COVID-19/... | 24.402985 | 135 | 0.727217 | 0 | 0 | 131 | 0.080122 | 0 | 0 | 0 | 0 | 656 | 0.401223 |
fb91820e24893ea883a473af50f1667df4df55ca | 28,698 | py | Python | mhcflurry/select_allele_specific_models_command.py | ignatovmg/mhcflurry | a4b0ac96ebe7f8be7e4b37f21c430f567ac630e6 | [
"Apache-2.0"
] | 113 | 2018-02-07T05:01:40.000Z | 2022-03-24T14:22:58.000Z | mhcflurry/select_allele_specific_models_command.py | ignatovmg/mhcflurry | a4b0ac96ebe7f8be7e4b37f21c430f567ac630e6 | [
"Apache-2.0"
] | 106 | 2015-09-15T20:12:20.000Z | 2017-12-23T01:54:54.000Z | mhcflurry/select_allele_specific_models_command.py | ignatovmg/mhcflurry | a4b0ac96ebe7f8be7e4b37f21c430f567ac630e6 | [
"Apache-2.0"
] | 33 | 2018-07-09T18:16:44.000Z | 2022-02-21T17:38:26.000Z | """
Model select class1 single allele models.
"""
import argparse
import os
import signal
import sys
import time
import traceback
import random
from functools import partial
from pprint import pprint
import numpy
import pandas
from scipy.stats import kendalltau, percentileofscore, pearsonr
from sklearn.metrics import ... | 36.007528 | 101 | 0.643703 | 11,746 | 0.409297 | 0 | 0 | 241 | 0.008398 | 0 | 0 | 5,750 | 0.200362 |
fb93199fe7cc80dd48c6b172980feb9638eeb2ac | 623 | py | Python | CircuitPython_Made_Easy_On_CPX/cpx_temperature_neopixels.py | joewalk102/Adafruit_Learning_System_Guides | 2bda607f8c433c661a2d9d40b4db4fd132334c9a | [
"MIT"
] | 665 | 2017-09-27T21:20:14.000Z | 2022-03-31T09:09:25.000Z | CircuitPython_Made_Easy_On_CPX/cpx_temperature_neopixels.py | joewalk102/Adafruit_Learning_System_Guides | 2bda607f8c433c661a2d9d40b4db4fd132334c9a | [
"MIT"
] | 641 | 2017-10-03T19:46:37.000Z | 2022-03-30T18:28:46.000Z | CircuitPython_Made_Easy_On_CPX/cpx_temperature_neopixels.py | joewalk102/Adafruit_Learning_System_Guides | 2bda607f8c433c661a2d9d40b4db4fd132334c9a | [
"MIT"
] | 734 | 2017-10-02T22:47:38.000Z | 2022-03-30T14:03:51.000Z | import time
from adafruit_circuitplayground.express import cpx
import simpleio
cpx.pixels.auto_write = False
cpx.pixels.brightness = 0.3
# Set these based on your ambient temperature for best results!
minimum_temp = 24
maximum_temp = 30
while True:
# temperature value remapped to pixel position
peak = simple... | 24.92 | 81 | 0.667737 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 109 | 0.17496 |
fb944044bfb463a8599ee79bec50521d35a9aa25 | 1,086 | py | Python | Python_Fundamentals/06_Object_And_Classes/task_object_and_classes/d_exercises.py | Dochko0/Python | e9612c4e842cfd3d9a733526cc7485765ef2238f | [
"MIT"
] | null | null | null | Python_Fundamentals/06_Object_And_Classes/task_object_and_classes/d_exercises.py | Dochko0/Python | e9612c4e842cfd3d9a733526cc7485765ef2238f | [
"MIT"
] | null | null | null | Python_Fundamentals/06_Object_And_Classes/task_object_and_classes/d_exercises.py | Dochko0/Python | e9612c4e842cfd3d9a733526cc7485765ef2238f | [
"MIT"
] | null | null | null | class Exercises:
def __init__(self, topic, course_name, judge_contest_link, problems):
self.topic = topic
self.course_name = course_name
self.judge_contest_link = judge_contest_link
self.problems = [*problems]
def get_info(self):
info = f'Exercises: {self.topic}\n' \
... | 29.351351 | 99 | 0.604052 | 727 | 0.669429 | 0 | 0 | 0 | 0 | 0 | 0 | 254 | 0.233886 |
fb9503385f519e775914f1b2f2d3dd6a4f2477ad | 15,037 | py | Python | Machine Learning Summer School 2019 (London, UK)/tutorials/mcmc/2 - markov_chain_monte_carlo.py | xuedong/rlss2019 | d7468c2fcf269d8afd6fb0f44993aa9797867944 | [
"MIT"
] | null | null | null | Machine Learning Summer School 2019 (London, UK)/tutorials/mcmc/2 - markov_chain_monte_carlo.py | xuedong/rlss2019 | d7468c2fcf269d8afd6fb0f44993aa9797867944 | [
"MIT"
] | null | null | null | Machine Learning Summer School 2019 (London, UK)/tutorials/mcmc/2 - markov_chain_monte_carlo.py | xuedong/rlss2019 | d7468c2fcf269d8afd6fb0f44993aa9797867944 | [
"MIT"
] | null | null | null | ############################################################
# Copyright 2019 Michael Betancourt
# Licensed under the new BSD (3-clause) license:
#
# https://opensource.org/licenses/BSD-3-Clause
############################################################
############################################################
#
... | 31.524109 | 92 | 0.608499 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4,517 | 0.300392 |
fb9534493c6c33c290455dafb3878a1f3ed9246b | 454 | py | Python | opendbc/generator/test_generator.py | darknight111/openpilot3 | a0c755fbe1889f26404a8225816f57e89fde7bc2 | [
"MIT"
] | 116 | 2018-03-07T09:00:10.000Z | 2020-04-06T18:37:45.000Z | opendbc/generator/test_generator.py | darknight111/openpilot3 | a0c755fbe1889f26404a8225816f57e89fde7bc2 | [
"MIT"
] | 66 | 2020-04-09T20:27:57.000Z | 2022-01-27T14:39:24.000Z | opendbc/generator/test_generator.py | darknight111/openpilot3 | a0c755fbe1889f26404a8225816f57e89fde7bc2 | [
"MIT"
] | 154 | 2020-04-08T21:41:22.000Z | 2022-03-17T21:05:33.000Z | #!/usr/bin/env python3
import os
import filecmp
import tempfile
from opendbc.generator.generator import create_all, opendbc_root
def test_generator():
with tempfile.TemporaryDirectory() as d:
create_all(d)
ignore = [f for f in os.listdir(opendbc_root) if not f.endswith('_generated.dbc')]
comp = filecmp... | 26.705882 | 86 | 0.746696 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 75 | 0.165198 |
fb95d8cb21b1ef70d5c86b417371dd007196c3a0 | 3,575 | py | Python | src/vigorish/scrape/brooks_pitchfx/scrape_task.py | a-luna/vigorish | 6cede5ced76c7d2c9ad0aacdbd2b18c2f1ee4ee6 | [
"MIT"
] | 2 | 2021-07-15T13:53:33.000Z | 2021-07-25T17:03:29.000Z | src/vigorish/scrape/brooks_pitchfx/scrape_task.py | a-luna/vigorish | 6cede5ced76c7d2c9ad0aacdbd2b18c2f1ee4ee6 | [
"MIT"
] | 650 | 2019-05-18T07:00:12.000Z | 2022-01-21T19:38:55.000Z | src/vigorish/scrape/brooks_pitchfx/scrape_task.py | a-luna/vigorish | 6cede5ced76c7d2c9ad0aacdbd2b18c2f1ee4ee6 | [
"MIT"
] | 2 | 2020-03-28T21:01:31.000Z | 2022-01-06T05:16:11.000Z | import vigorish.database as db
from vigorish.enums import DataSet, ScrapeCondition
from vigorish.scrape.brooks_pitchfx.parse_html import parse_pitchfx_log
from vigorish.scrape.scrape_task import ScrapeTaskABC
from vigorish.status.update_status_brooks_pitchfx import update_status_brooks_pitchfx_log
from vigorish.util.dt... | 45.833333 | 99 | 0.645315 | 3,177 | 0.888671 | 0 | 0 | 0 | 0 | 0 | 0 | 306 | 0.085594 |
fb96d6004d5d3c7514625831b9038ed27e6e0930 | 10,309 | py | Python | mayan/apps/rest_api/classes.py | atitaya1412/Mayan-EDMS | bda9302ba4b743e7d829ad118b8b836221888172 | [
"Apache-2.0"
] | 336 | 2019-05-09T07:05:19.000Z | 2022-03-25T09:50:22.000Z | mayan/apps/rest_api/classes.py | atitaya1412/Mayan-EDMS | bda9302ba4b743e7d829ad118b8b836221888172 | [
"Apache-2.0"
] | 9 | 2019-10-29T00:12:27.000Z | 2021-09-09T15:16:51.000Z | mayan/apps/rest_api/classes.py | atitaya1412/Mayan-EDMS | bda9302ba4b743e7d829ad118b8b836221888172 | [
"Apache-2.0"
] | 257 | 2019-05-14T10:26:37.000Z | 2022-03-30T03:37:36.000Z | from collections import namedtuple
import io
import json
from furl import furl
from django.core.handlers.wsgi import WSGIRequest
from django.http.request import QueryDict
from django.template import Variable, VariableDoesNotExist
from django.test.client import MULTIPART_CONTENT
from django.urls import resolve
from dj... | 34.363333 | 85 | 0.549811 | 9,629 | 0.934038 | 0 | 0 | 0 | 0 | 0 | 0 | 752 | 0.072946 |
fb97354673fa2e5ae7cab8bfd23169b53bcbcce7 | 254 | py | Python | python/griddly/util/rllib/torch/agents/common.py | maichmueller/Griddly | 25b978a08f13226de2831d0941af0f37fea12718 | [
"MIT"
] | 93 | 2020-05-29T14:36:46.000Z | 2022-03-28T02:58:04.000Z | python/griddly/util/rllib/torch/agents/common.py | maichmueller/Griddly | 25b978a08f13226de2831d0941af0f37fea12718 | [
"MIT"
] | 35 | 2020-07-22T16:43:03.000Z | 2022-03-30T19:50:20.000Z | python/griddly/util/rllib/torch/agents/common.py | maichmueller/Griddly | 25b978a08f13226de2831d0941af0f37fea12718 | [
"MIT"
] | 13 | 2020-07-22T08:24:28.000Z | 2022-01-28T06:58:38.000Z | import numpy as np
from torch import nn
def layer_init(layer, std=np.sqrt(2), bias_const=0.0):
"""
Simple function to init layers
"""
nn.init.orthogonal_(layer.weight, std)
nn.init.constant_(layer.bias, bias_const)
return layer
| 21.166667 | 54 | 0.685039 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 46 | 0.181102 |
fb97fb152011251fca82737d7f9e6211e38b167b | 9,414 | py | Python | turnitin/src9.py | alvaedu/NYUsakai11 | 2434f320c49072d23af77062ea763228374f4c25 | [
"ECL-2.0"
] | 4 | 2017-03-22T16:57:42.000Z | 2020-04-07T17:34:41.000Z | turnitin/src9.py | alvaedu/NYUsakai11 | 2434f320c49072d23af77062ea763228374f4c25 | [
"ECL-2.0"
] | 216 | 2016-06-23T14:02:32.000Z | 2021-08-31T17:11:24.000Z | turnitin/src9.py | alvaedu/NYUsakai11 | 2434f320c49072d23af77062ea763228374f4c25 | [
"ECL-2.0"
] | 15 | 2016-06-17T16:26:08.000Z | 2017-08-19T21:06:33.000Z | """
Test script for src=9 provisioning
Below are some odd examples and notes:
Adding a class
{
'src': '9',
'uln': 'Githens',
'ufn': 'Steven',
'aid': '56021',
'utp': '2',
'said': '56021',
'fid': '2',
'username': 'swgithen',
'ctl': 'CourseTitleb018b622-b425-4af7-bb3d-d0d2b4deb35c',
'diagnost... | 34.866667 | 461 | 0.652008 | 1,069 | 0.113554 | 0 | 0 | 0 | 0 | 0 | 0 | 5,759 | 0.611748 |
fb99379467ad51c39cd5405a13aedf9d925212e0 | 40 | py | Python | test.py | probot1511/test_repo | 9dee2d2eb1c44c09d04d91861b3f9bd2b63c4e0f | [
"MIT"
] | null | null | null | test.py | probot1511/test_repo | 9dee2d2eb1c44c09d04d91861b3f9bd2b63c4e0f | [
"MIT"
] | null | null | null | test.py | probot1511/test_repo | 9dee2d2eb1c44c09d04d91861b3f9bd2b63c4e0f | [
"MIT"
] | 1 | 2022-01-31T19:24:49.000Z | 2022-01-31T19:24:49.000Z | print("RUnning!!!")
print("Updated!!!")
| 13.333333 | 19 | 0.6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 24 | 0.6 |
fb9987081ed710e35f756b48711ebeb1fdc7fbe0 | 2,309 | py | Python | tests/parser/choice.47.test.py | veltri/DLV2 | 944aaef803aa75e7ec51d7e0c2b0d964687fdd0e | [
"Apache-2.0"
] | null | null | null | tests/parser/choice.47.test.py | veltri/DLV2 | 944aaef803aa75e7ec51d7e0c2b0d964687fdd0e | [
"Apache-2.0"
] | null | null | null | tests/parser/choice.47.test.py | veltri/DLV2 | 944aaef803aa75e7ec51d7e0c2b0d964687fdd0e | [
"Apache-2.0"
] | null | null | null | input = """
% This is a synthetic example documenting a bug in an early version of DLV's
% backjumping algorithm.
% The abstract computation tree looks as follows (choice order should be fixed
% by disabling heuristics with -OH-):
%
% o
% a / \ -a
% / \_..._
% o \
% ... | 23.323232 | 79 | 0.60589 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,290 | 0.991771 |
fb9ad71d95d0e5101ca350ea6c907e1e31dc4b55 | 7,189 | py | Python | functions.py | brupoon/blackfork | 8acf49907b7140894f72255f5ccd3e3e7cd638a0 | [
"MIT"
] | null | null | null | functions.py | brupoon/blackfork | 8acf49907b7140894f72255f5ccd3e3e7cd638a0 | [
"MIT"
] | null | null | null | functions.py | brupoon/blackfork | 8acf49907b7140894f72255f5ccd3e3e7cd638a0 | [
"MIT"
] | null | null | null | from __future__ import division
from random import *
#...(former location of probability as a FN GLOBAL)
#OUR SUPERCOOL GENETIC MUTANT NINJA TURTALGORITHM
def genetics(sampleList):
winLoss = [] #win/loss arrays for each sample
for sample in range(sampleList):
winLoss.append(isWinSample(sampleList[sampl... | 31.669604 | 100 | 0.640979 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,381 | 0.3312 |
fb9c65b9797d0529bc740e716a16f8507c95db85 | 1,567 | py | Python | testframework/checkers/spanner_checker.py | emartech/ems-dataflow-testframework | c70b0768573e9c4af98173bb0b444dee442de53a | [
"MIT"
] | null | null | null | testframework/checkers/spanner_checker.py | emartech/ems-dataflow-testframework | c70b0768573e9c4af98173bb0b444dee442de53a | [
"MIT"
] | null | null | null | testframework/checkers/spanner_checker.py | emartech/ems-dataflow-testframework | c70b0768573e9c4af98173bb0b444dee442de53a | [
"MIT"
] | 1 | 2022-02-17T19:56:44.000Z | 2022-02-17T19:56:44.000Z | import logging
from collections import Generator
from typing import Dict
from spanner import ems_spanner_client
from tenacity import retry, stop_after_attempt, wait_fixed
class SpannerChecker:
STOP_AFTER_ATTEMPT_SECS = 15
WAIT_FIXED = 3
def __init__(self, project_id: str, instance_id: str, db_name: str)... | 37.309524 | 103 | 0.685386 | 1,392 | 0.888322 | 0 | 0 | 687 | 0.438417 | 0 | 0 | 179 | 0.114231 |
fb9c6e6bdafc518cc8754d80b7344aed59410824 | 458 | py | Python | src/sniptly/output.py | jjaakko/sniptly | c8190294f75a7b3db26af40e4b3592b5c5971b91 | [
"MIT"
] | null | null | null | src/sniptly/output.py | jjaakko/sniptly | c8190294f75a7b3db26af40e4b3592b5c5971b91 | [
"MIT"
] | null | null | null | src/sniptly/output.py | jjaakko/sniptly | c8190294f75a7b3db26af40e4b3592b5c5971b91 | [
"MIT"
] | null | null | null | from typing import Any
from click import echo, style
def out(message: str, new_line: bool = True, **styles: Any) -> None:
if "bold" not in styles:
styles["bold"] = True
message = style(message, **styles)
echo(message, nl=new_line)
def err(message: str, new_line: bool = True, **styles: Any) -... | 26.941176 | 68 | 0.615721 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 25 | 0.054585 |
fb9d867e25a8da5be0e4b33fa5b6bfbaf98a5fde | 298 | py | Python | bookmarks/images/signals.py | hiteshgarg14/Django-Social-Website | 750f3b6e457a0da84e3fe4eaa56f54cb007d9e1e | [
"MIT"
] | 1 | 2020-11-19T19:33:10.000Z | 2020-11-19T19:33:10.000Z | bookmarks/images/signals.py | hiteshgarg14/Django-Social-Website | 750f3b6e457a0da84e3fe4eaa56f54cb007d9e1e | [
"MIT"
] | null | null | null | bookmarks/images/signals.py | hiteshgarg14/Django-Social-Website | 750f3b6e457a0da84e3fe4eaa56f54cb007d9e1e | [
"MIT"
] | null | null | null | from django.db.models.signals import m2m_changed
from django.dispatch import receiver
from .models import Image
@receiver(m2m_changed, sender=Image.users_likes.through)
def users_like_changed(sender, instance, **kwargs):
instance.total_likes = instance.users_likes.count()
instance.save()
| 33.111111 | 56 | 0.802013 | 0 | 0 | 0 | 0 | 184 | 0.61745 | 0 | 0 | 0 | 0 |
fb9daa303c7186ca7833c4c97259f8015245fe48 | 4,579 | py | Python | src/nemo/transforms.py | thomasjo/nemo-redux | c4196c0d99633dca011d60008be0cb7667c348b7 | [
"MIT"
] | null | null | null | src/nemo/transforms.py | thomasjo/nemo-redux | c4196c0d99633dca011d60008be0cb7667c348b7 | [
"MIT"
] | null | null | null | src/nemo/transforms.py | thomasjo/nemo-redux | c4196c0d99633dca011d60008be0cb7667c348b7 | [
"MIT"
] | null | null | null | import random
from typing import List, Union
import torch
import torchvision.transforms as T
import torchvision.transforms.functional as F
from PIL import Image
class RandomDiscreteRotation():
def __init__(self, angles, resample=0, expand=False):
self.angles = angles
self.resample = resample
... | 28.798742 | 103 | 0.602752 | 3,825 | 0.835335 | 0 | 0 | 0 | 0 | 0 | 0 | 398 | 0.086919 |
fb9fdfc27bb90a2635e9ed5a41c5798497074c0d | 154 | py | Python | zadania-python/zadanie#8.01-03/zadanie_8_01.py | Qeentissue/wizualizacja-danych | 36914230ff1c28d8a5cd05a2d4dfd5d3f4ddc1b0 | [
"MIT"
] | null | null | null | zadania-python/zadanie#8.01-03/zadanie_8_01.py | Qeentissue/wizualizacja-danych | 36914230ff1c28d8a5cd05a2d4dfd5d3f4ddc1b0 | [
"MIT"
] | null | null | null | zadania-python/zadanie#8.01-03/zadanie_8_01.py | Qeentissue/wizualizacja-danych | 36914230ff1c28d8a5cd05a2d4dfd5d3f4ddc1b0 | [
"MIT"
] | null | null | null | import pandas as pd
# Wczytaj do DataFrame arkusz z narodzinami dzieci
# w Polsce dostępny pod adresem
df = pd.read_csv('Imiona_dzieci_2000-2019.csv')
| 22 | 50 | 0.779221 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 112 | 0.722581 |
fba184b6f53f7d77cbaf5e8e08d7ed47d47fd543 | 5,950 | py | Python | vgg16_imagenet.py | jamccomb92/TransferLearningPneuomia | d476cb89dc75e51ea7bbbea3542590fe0e74dfaa | [
"MIT"
] | null | null | null | vgg16_imagenet.py | jamccomb92/TransferLearningPneuomia | d476cb89dc75e51ea7bbbea3542590fe0e74dfaa | [
"MIT"
] | null | null | null | vgg16_imagenet.py | jamccomb92/TransferLearningPneuomia | d476cb89dc75e51ea7bbbea3542590fe0e74dfaa | [
"MIT"
] | null | null | null | \
import os
from keras import applications
import keras
import tensorflow as tf
import time
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
keras.backend.tensorflow_backend.set_session(tf.Session(config=config))
from keras.models import Model
from keras.layers import Input, Conv2D, MaxPooling2D, Fl... | 58.910891 | 271 | 0.381849 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,809 | 0.472101 |
fba2be86b846eae4b6b694478e685649917f0dba | 7,761 | py | Python | mvpa2/tests/test_procrust.py | mortonne/PyMVPA | 98644c5cd9733edd39fac746ea7cf67398674645 | [
"MIT"
] | null | null | null | mvpa2/tests/test_procrust.py | mortonne/PyMVPA | 98644c5cd9733edd39fac746ea7cf67398674645 | [
"MIT"
] | null | null | null | mvpa2/tests/test_procrust.py | mortonne/PyMVPA | 98644c5cd9733edd39fac746ea7cf67398674645 | [
"MIT"
] | null | null | null | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the PyMVPA package for the
# copyright and license terms.
#
### ### ### ### ###... | 37.492754 | 88 | 0.47365 | 6,735 | 0.867801 | 0 | 0 | 6,676 | 0.860198 | 0 | 0 | 2,141 | 0.275867 |
fba413cbbac04e4578ce84a8676b8bf632b9cb46 | 431 | py | Python | configs/production.py | syz247179876/Flask-Sports | ed2d21c5a6172e7b6f3fc479bd5114fdb171896d | [
"Apache-2.0"
] | 2 | 2020-12-02T14:20:44.000Z | 2020-12-08T15:36:51.000Z | configs/production.py | syz247179876/Flask-Sports | ed2d21c5a6172e7b6f3fc479bd5114fdb171896d | [
"Apache-2.0"
] | 1 | 2020-12-05T13:44:14.000Z | 2020-12-05T13:44:14.000Z | configs/production.py | syz247179876/Flask-Sports | ed2d21c5a6172e7b6f3fc479bd5114fdb171896d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2020/12/1 下午11:24
# @Author : 司云中
# @File : production.py
# @Software: Pycharm
from configs.default import DefaultConfig
class ProductionConfig(DefaultConfig):
"""the config of production env"""
DEBUG = False
TESTING = False
MONGODB_DB = ''
MONGODB_HOST = ''
... | 20.52381 | 41 | 0.656613 | 231 | 0.52381 | 0 | 0 | 0 | 0 | 0 | 0 | 163 | 0.369615 |
fba528d6b9c993f8745f860d915d34b0353a4f4d | 426 | py | Python | glider/test/test_gliderRadio.py | ezeakeal/glider_drone | f0d5bb973d38245351a0fe1f4833827d94d0b0e4 | [
"Apache-2.0"
] | null | null | null | glider/test/test_gliderRadio.py | ezeakeal/glider_drone | f0d5bb973d38245351a0fe1f4833827d94d0b0e4 | [
"Apache-2.0"
] | null | null | null | glider/test/test_gliderRadio.py | ezeakeal/glider_drone | f0d5bb973d38245351a0fe1f4833827d94d0b0e4 | [
"Apache-2.0"
] | null | null | null | from unittest import TestCase
from glider.modules.glider_radio import GliderRadio
class TestGliderRadio(TestCase):
def setUp(self):
self.radio = GliderRadio(self.test_callback)
self.radio.start()
def tearDown(self):
self.radio.stop()
def test_callback(self, msgdict):
prin... | 23.666667 | 52 | 0.678404 | 341 | 0.800469 | 0 | 0 | 0 | 0 | 0 | 0 | 28 | 0.065728 |
fba67a228cffbfee38985da067132482c7b8a08a | 1,052 | py | Python | apps/warframes/migrations/0001_initial.py | tufbel/wFocus | ee0f02053b8a5bc9c40dd862306fc5df1a063b9d | [
"Apache-2.0"
] | null | null | null | apps/warframes/migrations/0001_initial.py | tufbel/wFocus | ee0f02053b8a5bc9c40dd862306fc5df1a063b9d | [
"Apache-2.0"
] | 11 | 2020-06-06T01:51:51.000Z | 2022-02-10T14:31:21.000Z | apps/warframes/migrations/0001_initial.py | tufbel/wFocus | ee0f02053b8a5bc9c40dd862306fc5df1a063b9d | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.2.7 on 2019-12-15 12:15
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Warframe',
fields=[
('id', models.AutoField... | 32.875 | 76 | 0.543726 | 959 | 0.911597 | 0 | 0 | 0 | 0 | 0 | 0 | 179 | 0.170152 |
fba6946e547a329b3ac4d404e2ef31baf20b094f | 5,290 | py | Python | pxr/base/tf/testenv/testTfStringUtils.py | DougRogers-DigitalFish/USD | d8a405a1344480f859f025c4f97085143efacb53 | [
"BSD-2-Clause"
] | 3,680 | 2016-07-26T18:28:11.000Z | 2022-03-31T09:55:05.000Z | pxr/base/tf/testenv/testTfStringUtils.py | DougRogers-DigitalFish/USD | d8a405a1344480f859f025c4f97085143efacb53 | [
"BSD-2-Clause"
] | 1,759 | 2016-07-26T19:19:59.000Z | 2022-03-31T21:24:00.000Z | pxr/base/tf/testenv/testTfStringUtils.py | DougRogers-DigitalFish/USD | d8a405a1344480f859f025c4f97085143efacb53 | [
"BSD-2-Clause"
] | 904 | 2016-07-26T18:33:40.000Z | 2022-03-31T09:55:16.000Z | #!/pxrpythonsubst
#
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
... | 38.613139 | 79 | 0.633648 | 4,111 | 0.777127 | 0 | 0 | 0 | 0 | 0 | 0 | 2,087 | 0.394518 |
fba6b995d133300dd22ec22078918d89b609c5b5 | 4,300 | py | Python | oui/return_arp.py | sukhjinderpalsingh/ansible | 07669bfc1e072af670f32a6ba037513c470caf8d | [
"Unlicense"
] | 4 | 2019-04-17T13:16:58.000Z | 2020-05-05T23:07:35.000Z | oui/return_arp.py | sukhjinderpalsingh/ansible | 07669bfc1e072af670f32a6ba037513c470caf8d | [
"Unlicense"
] | null | null | null | oui/return_arp.py | sukhjinderpalsingh/ansible | 07669bfc1e072af670f32a6ba037513c470caf8d | [
"Unlicense"
] | 1 | 2019-05-23T17:24:16.000Z | 2019-05-23T17:24:16.000Z | #!/usr/bin/python
import subprocess
import sys
import cgi
import datetime
import re
import requests
validMac = False
ERROR = False
form = cgi.FieldStorage()
user = "READONLY_USER_HERE"
pwd = "PASSWORD"
OUI = form.getvalue('OUI')
host = form.getvalue('HOST')
def formatOUI(OUI):
ot=OUI[0:2]
... | 33.858268 | 172 | 0.428837 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,121 | 0.260698 |
fba8bbf32782335bea4f2efd30632d40070c98c8 | 1,801 | py | Python | scripts/propogate_elab_labels.py | dmort27/elab-order | 5fdca996eea8ab5c6520f9ba565f2fc2cf3e9d0a | [
"MIT"
] | 1 | 2021-09-22T00:28:54.000Z | 2021-09-22T00:28:54.000Z | scripts/propogate_elab_labels.py | dmort27/elab-order | 5fdca996eea8ab5c6520f9ba565f2fc2cf3e9d0a | [
"MIT"
] | null | null | null | scripts/propogate_elab_labels.py | dmort27/elab-order | 5fdca996eea8ab5c6520f9ba565f2fc2cf3e9d0a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import csv
import glob
import os.path
from collections import deque
from tqdm import tqdm
def read_csv(fnin):
with open(fnin) as f:
return {tuple(e) for e in csv.reader(f)}
def write_tagged_span(fout, buffer, count):
b_token = buffer.popleft()
print(f'{b_token}\tB', file=f... | 30.525424 | 67 | 0.583009 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 217 | 0.120489 |
fba8db75cec306c3be997ed165eb4fd61c2a754f | 1,691 | py | Python | python/ml_preproc/pipeline/beam_classes/parse_csv.py | gmogr/dataflow-production-ready | 838dc45d0a01db184ce3f88728303d8ed69361f3 | [
"Apache-2.0"
] | 1 | 2021-01-26T16:58:20.000Z | 2021-01-26T16:58:20.000Z | python/ml_preproc/pipeline/beam_classes/parse_csv.py | gmogr/dataflow-production-ready | 838dc45d0a01db184ce3f88728303d8ed69361f3 | [
"Apache-2.0"
] | null | null | null | python/ml_preproc/pipeline/beam_classes/parse_csv.py | gmogr/dataflow-production-ready | 838dc45d0a01db184ce3f88728303d8ed69361f3 | [
"Apache-2.0"
] | 1 | 2021-04-15T09:18:27.000Z | 2021-04-15T09:18:27.000Z | # Copyright 2020 Google LLC.
# This software is provided as-is, without warranty or representation for any use or purpose.
# Your use of it is subject to your agreement with Google.
from apache_beam import DoFn, pvalue
from apache_beam.metrics import Metrics
from ..model import data_classes
from ..model.data_classe... | 39.325581 | 105 | 0.738025 | 1,353 | 0.800118 | 692 | 0.409225 | 0 | 0 | 0 | 0 | 726 | 0.429332 |
fba917b2c0de9b130231e038b70145fe9679fe7d | 2,285 | py | Python | src/sentry/integrations/pagerduty/client.py | pombredanne/django-sentry | 4ad09417fb3cfa3aa4a0d4175ae49fe02837c567 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/integrations/pagerduty/client.py | pombredanne/django-sentry | 4ad09417fb3cfa3aa4a0d4175ae49fe02837c567 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/integrations/pagerduty/client.py | pombredanne/django-sentry | 4ad09417fb3cfa3aa4a0d4175ae49fe02837c567 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from sentry.integrations.client import ApiClient
from sentry.models import EventCommon
from sentry.api.serializers import serialize, ExternalEventSerializer
LEVEL_SEVERITY_MAP = {
"debug": "info",
"info": "info",
"warning": "warning",
"error": "error",
"fatal... | 34.621212 | 95 | 0.569365 | 1,945 | 0.851204 | 0 | 0 | 0 | 0 | 0 | 0 | 507 | 0.221882 |
fbaa2cc659c7ec0bddf4650c7e382079513809ba | 3,192 | py | Python | darling_ansible/python_venv/lib/python3.7/site-packages/oci/monitoring/models/failed_metric_record.py | revnav/sandbox | f9c8422233d093b76821686b6c249417502cf61d | [
"Apache-2.0"
] | null | null | null | darling_ansible/python_venv/lib/python3.7/site-packages/oci/monitoring/models/failed_metric_record.py | revnav/sandbox | f9c8422233d093b76821686b6c249417502cf61d | [
"Apache-2.0"
] | null | null | null | darling_ansible/python_venv/lib/python3.7/site-packages/oci/monitoring/models/failed_metric_record.py | revnav/sandbox | f9c8422233d093b76821686b6c249417502cf61d | [
"Apache-2.0"
] | 1 | 2020-06-25T03:12:58.000Z | 2020-06-25T03:12:58.000Z | # coding: utf-8
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 31.294118 | 245 | 0.658835 | 2,652 | 0.830827 | 0 | 0 | 2,682 | 0.840226 | 0 | 0 | 2,087 | 0.653822 |
fbab99a6802fc429bbfb9a29c754e3ca6d940978 | 3,352 | py | Python | PyBlend/pyblend_prism.py | nfb2021/PrismPyTrace | d4f28cd4156b5543abc3b5634383a81b0663d28e | [
"MIT"
] | null | null | null | PyBlend/pyblend_prism.py | nfb2021/PrismPyTrace | d4f28cd4156b5543abc3b5634383a81b0663d28e | [
"MIT"
] | null | null | null | PyBlend/pyblend_prism.py | nfb2021/PrismPyTrace | d4f28cd4156b5543abc3b5634383a81b0663d28e | [
"MIT"
] | null | null | null | import bpy
import numpy as np
import math
import mathutils
import time
import os
class Prism:
""" ^"""
""" / \\"""
""" / ^ \\"""
""" / | \\"""
""" /'alpha'\\ <-- lenght of this side is calculated based on 'width' and 'alpha'"""
"""/ \\"""
"""-------... | 34.556701 | 171 | 0.545346 | 3,251 | 0.969869 | 0 | 0 | 0 | 0 | 0 | 0 | 923 | 0.275358 |
fbac3a021640dbdfd78f68fea5a2c6021008a044 | 88 | py | Python | Source/RainyDay_utilities_Py3/__init__.py | Dewberry/RainyDay2 | ed3206b1d81ca4ffded4ed79bf156e4b8d87d143 | [
"MIT"
] | 12 | 2019-03-24T02:59:51.000Z | 2021-11-05T07:45:08.000Z | Source/RainyDay_utilities_Py3/__init__.py | Dewberry/RainyDay2 | ed3206b1d81ca4ffded4ed79bf156e4b8d87d143 | [
"MIT"
] | null | null | null | Source/RainyDay_utilities_Py3/__init__.py | Dewberry/RainyDay2 | ed3206b1d81ca4ffded4ed79bf156e4b8d87d143 | [
"MIT"
] | 13 | 2017-08-10T17:18:16.000Z | 2022-02-10T00:08:47.000Z | # -*- coding: utf-8 -*-
"""
Created on Fri Feb 6 17:38:00 2015
@author: dbwrigh3
"""
| 11 | 35 | 0.568182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 85 | 0.965909 |
fbad3dd268d46eacf42426eb3b88f2a9c9f71d9f | 526 | py | Python | setup.py | Lewinta/ProcesosLab | 223ddff1dd8d92403f9ded9f7a42b8f2fa8605f7 | [
"MIT"
] | null | null | null | setup.py | Lewinta/ProcesosLab | 223ddff1dd8d92403f9ded9f7a42b8f2fa8605f7 | [
"MIT"
] | null | null | null | setup.py | Lewinta/ProcesosLab | 223ddff1dd8d92403f9ded9f7a42b8f2fa8605f7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open('requirements.txt') as f:
install_requires = f.read().strip().split('\n')
# get version from __version__ variable in proceso/__init__.py
from proceso import __version__ as version
setup(
name='proceso',
version=version,
description='A ... | 25.047619 | 62 | 0.76616 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 188 | 0.357414 |
fbad48a7594776e5f25fe4470488384a1f723e04 | 3,650 | py | Python | eye/widgets/misc.py | hydrargyrum/eye | b4a6994fee74b7a70d4f918bc3a29184fe8d5526 | [
"WTFPL"
] | 12 | 2015-09-07T18:32:15.000Z | 2021-02-21T17:29:15.000Z | eye/widgets/misc.py | hydrargyrum/eye | b4a6994fee74b7a70d4f918bc3a29184fe8d5526 | [
"WTFPL"
] | 20 | 2016-08-01T19:24:43.000Z | 2020-12-23T21:29:04.000Z | eye/widgets/misc.py | hydrargyrum/eye | b4a6994fee74b7a70d4f918bc3a29184fe8d5526 | [
"WTFPL"
] | 1 | 2018-09-07T14:26:24.000Z | 2018-09-07T14:26:24.000Z | # this project is licensed under the WTFPLv2, see COPYING.txt for details
import logging
from weakref import ref
from PyQt5.QtCore import QEventLoop
from PyQt5.QtWidgets import QPlainTextEdit, QLabel, QWidget, QRubberBand, QApplication
from ..app import qApp
from ..qt import Slot, Signal
from .helpers import WidgetM... | 25 | 115 | 0.712603 | 3,002 | 0.822466 | 0 | 0 | 943 | 0.258356 | 0 | 0 | 834 | 0.228493 |
fbadf16ea0f58eaa3cba965310bc72b10eb1a906 | 10,437 | py | Python | envelopes/envelope.py | siyaoyao/envelopes | 8ad190a55d0d8b805b6ae545b896e719467253b7 | [
"MIT"
] | 202 | 2015-01-04T10:40:04.000Z | 2022-03-17T16:58:22.000Z | envelopes/envelope.py | siyaoyao/envelopes | 8ad190a55d0d8b805b6ae545b896e719467253b7 | [
"MIT"
] | 12 | 2015-04-29T08:12:36.000Z | 2021-06-03T01:34:33.000Z | envelopes/envelope.py | siyaoyao/envelopes | 8ad190a55d0d8b805b6ae545b896e719467253b7 | [
"MIT"
] | 48 | 2015-01-04T10:39:52.000Z | 2022-02-28T03:25:16.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2013 Tomasz Wójcik <[email protected]>
#
# 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
# ... | 31.531722 | 106 | 0.598927 | 8,407 | 0.805422 | 0 | 0 | 767 | 0.073482 | 0 | 0 | 3,664 | 0.351025 |
fbaea2b0a2ec669b63e49046a42524be78db8577 | 4,929 | py | Python | dependencies/panda/Pmw/Pmw_2_0_1/lib/PmwOptionMenu.py | SuperM0use24/Project-Altis | 8dec7518a4d3f902cee261fd522ebebc3c171a42 | [
"Apache-2.0"
] | null | null | null | dependencies/panda/Pmw/Pmw_2_0_1/lib/PmwOptionMenu.py | SuperM0use24/Project-Altis | 8dec7518a4d3f902cee261fd522ebebc3c171a42 | [
"Apache-2.0"
] | null | null | null | dependencies/panda/Pmw/Pmw_2_0_1/lib/PmwOptionMenu.py | SuperM0use24/Project-Altis | 8dec7518a4d3f902cee261fd522ebebc3c171a42 | [
"Apache-2.0"
] | null | null | null | import types
import tkinter
import Pmw
import sys
import collections
class OptionMenu(Pmw.MegaWidget):
def __init__(self, parent = None, **kw):
# Define the megawidget options.
INITOPT = Pmw.INITOPT
optiondefs = (
('command', None, None),
('items', ... | 33.080537 | 79 | 0.529113 | 4,858 | 0.985595 | 0 | 0 | 0 | 0 | 0 | 0 | 845 | 0.171434 |
fbaf22f54791d4657c17a86b0e49e13fd65f1463 | 7,614 | py | Python | options/train_options.py | fatalfeel/DeblurGAN | cc4ccf09d23b91389dbea70a34797cb80331819c | [
"BSD-3-Clause"
] | 3 | 2021-07-12T07:38:32.000Z | 2021-11-16T04:56:00.000Z | options/train_options.py | fatalfeel/DeblurGAN | cc4ccf09d23b91389dbea70a34797cb80331819c | [
"BSD-3-Clause"
] | 1 | 2021-11-03T09:57:31.000Z | 2021-11-04T03:00:49.000Z | options/train_options.py | fatalfeel/DeblurGAN | cc4ccf09d23b91389dbea70a34797cb80331819c | [
"BSD-3-Clause"
] | null | null | null | import os
import torch
import argparse
from util import util
def str2bool(b_str):
if b_str.lower() in ('yes', 'true', 't', 'y', '1'):
return True
elif b_str.lower() in ('no', 'false', 'f', 'n', '0'):
return False
class TrainOptions():
def __init__(self):
self.parser = argparse.Argu... | 89.576471 | 237 | 0.582217 | 7,374 | 0.968479 | 0 | 0 | 0 | 0 | 0 | 0 | 3,036 | 0.398739 |
fbb096d17208c7f5930144a24371f1c241611091 | 1,991 | py | Python | bin/tabletest.py | tjoneslo/pypdflite | ac2501f30d6619eae9dea5644717575ca9263d0a | [
"MIT"
] | 7 | 2016-05-19T02:23:42.000Z | 2020-04-16T16:19:13.000Z | bin/tabletest.py | tjoneslo/pypdflite | ac2501f30d6619eae9dea5644717575ca9263d0a | [
"MIT"
] | 5 | 2016-11-29T19:21:39.000Z | 2019-08-18T09:44:25.000Z | bin/tabletest.py | tjoneslo/pypdflite | ac2501f30d6619eae9dea5644717575ca9263d0a | [
"MIT"
] | 6 | 2017-01-23T02:12:52.000Z | 2020-07-07T22:34:44.000Z | import os
from pypdflite.pdflite import PDFLite
from pypdflite.pdfobjects.pdfcolor import PDFColor
def TableTest(test_dir):
""" Functional test for text, paragraph, and page
splitting.
"""
data = [["Heading1", "Heading2", "Heading3"],
["Cell a2", "Cell b2", "Cell c2"],
... | 32.639344 | 107 | 0.656454 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 743 | 0.373179 |
fbb17de1e27a39093c5016a288d1b4d494da72ba | 2,227 | py | Python | backend/app/literature/schemas/cross_reference_schemas.py | alliance-genome/agr_literature_service | 2278316422d5c3ab65e21bb97d91e861e48853c5 | [
"MIT"
] | null | null | null | backend/app/literature/schemas/cross_reference_schemas.py | alliance-genome/agr_literature_service | 2278316422d5c3ab65e21bb97d91e861e48853c5 | [
"MIT"
] | 39 | 2021-10-18T17:02:49.000Z | 2022-03-28T20:56:24.000Z | backend/app/literature/schemas/cross_reference_schemas.py | alliance-genome/agr_literature_service | 2278316422d5c3ab65e21bb97d91e861e48853c5 | [
"MIT"
] | 1 | 2021-10-21T00:11:18.000Z | 2021-10-21T00:11:18.000Z | from typing import List, Optional
from pydantic import BaseModel
from pydantic import validator
class CrossReferenceSchemaRelated(BaseModel):
curie: str
pages: Optional[List[str]] = None
is_obsolete: Optional[bool] = None
@validator('curie')
def name_must_contain_space(cls, v):
if v.coun... | 24.472527 | 62 | 0.594073 | 2,112 | 0.948361 | 0 | 0 | 196 | 0.088011 | 0 | 0 | 218 | 0.09789 |
fbb2c4cd37463a15b46ecf098fc46612a9561fb6 | 325 | py | Python | leetcode/53.py | jasonlmfong/leetcode | 490764b4212735915fa73e1a1bdfd40b8c8ad9ea | [
"MIT"
] | null | null | null | leetcode/53.py | jasonlmfong/leetcode | 490764b4212735915fa73e1a1bdfd40b8c8ad9ea | [
"MIT"
] | null | null | null | leetcode/53.py | jasonlmfong/leetcode | 490764b4212735915fa73e1a1bdfd40b8c8ad9ea | [
"MIT"
] | null | null | null | class Solution(object):
def maxSubArray(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
Max = -float("inf")
currMax = -float("inf")
for num in nums:
currMax = max(num, num + currMax)
Max = max(Max, currMax)
retur... | 25 | 45 | 0.461538 | 325 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 75 | 0.230769 |
fbb2df16b7c104eb5bf6d5b9289bada959a6f3e9 | 967 | py | Python | tests/test_resolver.py | manz/a816 | 2338ebf87039d6a4a4db8014c48c1d0d2488ceca | [
"MIT"
] | 2 | 2018-06-11T23:37:02.000Z | 2018-09-06T04:02:19.000Z | tests/test_resolver.py | manz/a816 | 2338ebf87039d6a4a4db8014c48c1d0d2488ceca | [
"MIT"
] | 8 | 2015-10-30T11:20:45.000Z | 2021-11-21T12:59:33.000Z | tests/test_resolver.py | manz/a816 | 2338ebf87039d6a4a4db8014c48c1d0d2488ceca | [
"MIT"
] | 1 | 2021-03-29T03:21:54.000Z | 2021-03-29T03:21:54.000Z | import unittest
from a816.parse.ast.expression import eval_expression_str
from a816.symbols import Resolver
class ResolverTest(unittest.TestCase):
def test_math_expr_eval(self) -> None:
expr = "0x100+toto & 0xFFFF"
resolver = Resolver()
resolver.current_scope.add_symbol("toto", 0x108000)... | 28.441176 | 69 | 0.663909 | 855 | 0.884178 | 0 | 0 | 0 | 0 | 0 | 0 | 65 | 0.067218 |
fbb43010f529aa881832d163b127b8c90dbb0317 | 4,445 | py | Python | syft_proto/frameworks/crypten/onnx_model_pb2.py | vkkhare/syft-proto | 513b4af50d7476bd5b1ff9dfb6da8528100f961d | [
"Apache-2.0"
] | null | null | null | syft_proto/frameworks/crypten/onnx_model_pb2.py | vkkhare/syft-proto | 513b4af50d7476bd5b1ff9dfb6da8528100f961d | [
"Apache-2.0"
] | null | null | null | syft_proto/frameworks/crypten/onnx_model_pb2.py | vkkhare/syft-proto | 513b4af50d7476bd5b1ff9dfb6da8528100f961d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: syft_proto/frameworks/crypten/onnx_model.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf im... | 46.302083 | 516 | 0.783127 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,553 | 0.349381 |
fbb5a43012f90f186d93e303de06bb99a2be6844 | 3,333 | py | Python | Actor_CriticPointer_Network-TSP/knapsack_env.py | GeoffNN/DLforCombin | 02553a50491420ab0d51860faff4f9d5aee59616 | [
"MIT"
] | 5 | 2017-12-29T12:16:37.000Z | 2020-05-24T22:53:56.000Z | Actor_CriticPointer_Network-TSP/knapsack_env.py | GeoffNN/DLforCombin | 02553a50491420ab0d51860faff4f9d5aee59616 | [
"MIT"
] | 1 | 2018-01-28T20:09:44.000Z | 2018-01-28T20:09:44.000Z | Actor_CriticPointer_Network-TSP/knapsack_env.py | GeoffNN/DLforCombin | 02553a50491420ab0d51860faff4f9d5aee59616 | [
"MIT"
] | 1 | 2020-05-24T22:53:50.000Z | 2020-05-24T22:53:50.000Z | import numpy as np
import knapsack
class Knapsack:
def __init__(self, K, max_weight, state_shape = 'flat', penalize_repeat = False):
self.K = K
self.max_weight = max_weight
self.penalize_repeat = penalize_repeat # Not used for now, have to figure out details
self.env_name = 'Knapsac... | 38.310345 | 110 | 0.584158 | 3,295 | 0.988599 | 0 | 0 | 0 | 0 | 0 | 0 | 145 | 0.043504 |
fbb6af8f01f84caaa96ba70cd3d046f928150b4b | 3,063 | py | Python | plotmonitor.py | mjlosch/python_scripts | 7e3c81382484a70a598e81da9ca260e45ad85a00 | [
"MIT"
] | 1 | 2020-11-20T20:07:06.000Z | 2020-11-20T20:07:06.000Z | plotmonitor.py | mjlosch/python_scripts | 7e3c81382484a70a598e81da9ca260e45ad85a00 | [
"MIT"
] | null | null | null | plotmonitor.py | mjlosch/python_scripts | 7e3c81382484a70a598e81da9ca260e45ad85a00 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: iso-8859-15 -*-
######################## -*- coding: utf-8 -*-
"""Usage: plotres.py variable INPUTFILE(S)
"""
import sys
from getopt import gnu_getopt as getopt
import matplotlib.pyplot as plt
import numpy as np
import datetime
# parse command-line arguments
try:
optlist,args =... | 26.179487 | 79 | 0.555664 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,165 | 0.380346 |
fbb7a78d183671e9c2e148567652110d81c620e9 | 14,266 | py | Python | src/primaires/communication/contextes/immersion.py | vlegoff/tsunami | 36b3b974f6eefbf15cd5d5f099fc14630e66570b | [
"BSD-3-Clause"
] | 14 | 2015-08-21T19:15:21.000Z | 2017-11-26T13:59:17.000Z | src/primaires/communication/contextes/immersion.py | vincent-lg/tsunami | 36b3b974f6eefbf15cd5d5f099fc14630e66570b | [
"BSD-3-Clause"
] | 20 | 2015-09-29T20:50:45.000Z | 2018-06-21T12:58:30.000Z | src/primaires/communication/contextes/immersion.py | vlegoff/tsunami | 36b3b974f6eefbf15cd5d5f099fc14630e66570b | [
"BSD-3-Clause"
] | 3 | 2015-05-02T19:42:03.000Z | 2018-09-06T10:55:00.000Z | # -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
... | 42.207101 | 80 | 0.570798 | 12,509 | 0.873107 | 0 | 0 | 75 | 0.005235 | 0 | 0 | 4,913 | 0.342919 |
fbb9ce8232b91bd4820115cf24c512ee8d3b9a6c | 2,104 | py | Python | Projects/ABM_DA/experiments/ukf_experiments/tests/arc_test.py | RobertClay/DUST-RC | 09f7ec9d8d093021d068dff8a7a48c15ea318b86 | [
"MIT"
] | 15 | 2018-11-21T14:57:24.000Z | 2022-03-04T15:42:09.000Z | Projects/ABM_DA/experiments/ukf_experiments/tests/arc_test.py | RobertClay/DUST-RC | 09f7ec9d8d093021d068dff8a7a48c15ea318b86 | [
"MIT"
] | 125 | 2019-11-06T13:03:35.000Z | 2022-03-07T13:38:33.000Z | Projects/ABM_DA/experiments/ukf_experiments/tests/arc_test.py | RobertClay/DUST-RC | 09f7ec9d8d093021d068dff8a7a48c15ea318b86 | [
"MIT"
] | 6 | 2018-11-20T15:56:49.000Z | 2021-10-08T10:21:06.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 13 12:07:22 2020
@author: medrclaa
Stand alone script for testing arc in ARC. simply run
pytest arc_test.py
To ensure the working environment is suitable for running experiments.
If you only wish to run a single experiment then you an easily ha... | 25.047619 | 82 | 0.63308 | 1,163 | 0.552757 | 0 | 0 | 50 | 0.023764 | 0 | 0 | 1,330 | 0.632129 |
fbbb3304e214d67619ec0cdb7ec6c61b33484d73 | 646 | py | Python | setup.py | dunkgray/nomics-python | 1e19647522f62e32218fa4cf859db68d26696d10 | [
"MIT"
] | null | null | null | setup.py | dunkgray/nomics-python | 1e19647522f62e32218fa4cf859db68d26696d10 | [
"MIT"
] | null | null | null | setup.py | dunkgray/nomics-python | 1e19647522f62e32218fa4cf859db68d26696d10 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name = "nomics-python",
version = "3.1.0",
author = "Taylor Facen",
author_email = "[email protected]",
description = "A python wrapper for the Nomics API",
long_description = long_desc... | 30.761905 | 57 | 0.653251 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 262 | 0.405573 |
fbbbe5438f901d187d2db29f2722a9a76b8e6ff6 | 2,177 | py | Python | tests/test_day3.py | ullumullu/adventofcode2020 | 0ad0e6ac7af7d3c21fe2cb42cbb8d29a992ae6d0 | [
"MIT"
] | null | null | null | tests/test_day3.py | ullumullu/adventofcode2020 | 0ad0e6ac7af7d3c21fe2cb42cbb8d29a992ae6d0 | [
"MIT"
] | null | null | null | tests/test_day3.py | ullumullu/adventofcode2020 | 0ad0e6ac7af7d3c21fe2cb42cbb8d29a992ae6d0 | [
"MIT"
] | null | null | null | import os
from pathlib import Path
from typing import List
from challenges.day3 import frequency_character
def _read_input() -> List[str]:
"""Read the input file."""
travel_map = []
current_path = Path(os.path.dirname(os.path.realpath(__file__)))
image_path = current_path / "resources" / "day3_puzzle_... | 32.984848 | 94 | 0.521819 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 429 | 0.19706 |
fbbc3f98679b551d2bd048c8773e0364748a4e51 | 2,333 | py | Python | test/test_format.py | GuyTuval/msgpack-python | 8fb709f2e0438862020d8810fa70a81fb5dac7d4 | [
"Apache-2.0"
] | 1,252 | 2015-01-05T18:18:10.000Z | 2022-03-27T16:40:44.000Z | test/test_format.py | GuyTuval/msgpack-python | 8fb709f2e0438862020d8810fa70a81fb5dac7d4 | [
"Apache-2.0"
] | 298 | 2015-01-06T12:21:09.000Z | 2022-03-11T23:57:58.000Z | test/test_format.py | GuyTuval/msgpack-python | 8fb709f2e0438862020d8810fa70a81fb5dac7d4 | [
"Apache-2.0"
] | 199 | 2015-01-09T04:33:00.000Z | 2022-03-30T15:04:37.000Z | #!/usr/bin/env python
# coding: utf-8
from msgpack import unpackb
def check(src, should, use_list=0, raw=True):
assert unpackb(src, use_list=use_list, raw=raw, strict_map_key=False) == should
def testSimpleValue():
check(b"\x93\xc0\xc2\xc3", (None, False, True))
def testFixnum():
check(b"\x92\x93\x00... | 25.358696 | 88 | 0.533648 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,037 | 0.444492 |
fbbc5a0d2746e83d3a087caa18124913a0952155 | 519 | py | Python | src/main/resources/pytz/zoneinfo/Asia/Brunei.py | TheEin/swagger-maven-plugin | cf93dce2d5c8d3534f4cf8c612b11e2d2313871b | [
"Apache-2.0"
] | 65 | 2015-11-14T13:46:01.000Z | 2021-08-14T05:54:04.000Z | lib/pytz/zoneinfo/Asia/Brunei.py | tjsavage/polymer-dashboard | 19bc467f1206613f8eec646b6f2bc43cc319ef75 | [
"CNRI-Python",
"Linux-OpenIB"
] | 13 | 2016-03-31T20:00:17.000Z | 2021-08-20T14:52:31.000Z | lib/pytz/zoneinfo/Asia/Brunei.py | tjsavage/polymer-dashboard | 19bc467f1206613f8eec646b6f2bc43cc319ef75 | [
"CNRI-Python",
"Linux-OpenIB"
] | 20 | 2015-03-18T08:41:37.000Z | 2020-12-18T02:58:30.000Z | '''tzinfo timezone information for Asia/Brunei.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Brunei(DstTzInfo):
'''Asia/Brunei timezone definition. See datetime.tzinfo for details'''
zone = 'Asia/Brunei'
_utc_tran... | 20.76 | 74 | 0.674374 | 318 | 0.612717 | 0 | 0 | 0 | 0 | 0 | 0 | 148 | 0.285164 |
fbbc6e1e7a5fe37234c1f6cec6987abfae3a501e | 4,184 | py | Python | raiden/tests/unit/test_messages.py | ConsenSysMesh/raiden | 76510e5535fa0a1ceb26107b560f805f3d7d26d9 | [
"MIT"
] | 3 | 2017-04-24T01:09:28.000Z | 2017-05-26T18:32:34.000Z | raiden/tests/unit/test_messages.py | ConsenSysMesh/raiden | 76510e5535fa0a1ceb26107b560f805f3d7d26d9 | [
"MIT"
] | 1 | 2021-10-31T12:41:15.000Z | 2021-10-31T12:41:15.000Z | raiden/tests/unit/test_messages.py | isabella232/raiden | 76510e5535fa0a1ceb26107b560f805f3d7d26d9 | [
"MIT"
] | 1 | 2021-10-31T12:05:52.000Z | 2021-10-31T12:05:52.000Z | # -*- coding: utf-8 -*-
import pytest
from raiden.messages import Ping, Ack, decode, Lock, MediatedTransfer
from raiden.utils import make_privkey_address, sha3
PRIVKEY, ADDRESS = make_privkey_address()
def test_signature():
ping = Ping(nonce=0)
ping.sign(PRIVKEY, ADDRESS)
assert ping.sender == ADDRESS
... | 25.668712 | 70 | 0.675908 | 0 | 0 | 0 | 0 | 1,328 | 0.3174 | 0 | 0 | 104 | 0.024857 |
fbbdd496f48c965142da201326e11323ba150849 | 6,428 | py | Python | python/helpful_scripts/circle_packing.py | Oilgrim/ivs_sim | 95dc017ef2aec32173e73dc397ba00177d4f92ce | [
"MIT"
] | null | null | null | python/helpful_scripts/circle_packing.py | Oilgrim/ivs_sim | 95dc017ef2aec32173e73dc397ba00177d4f92ce | [
"MIT"
] | null | null | null | python/helpful_scripts/circle_packing.py | Oilgrim/ivs_sim | 95dc017ef2aec32173e73dc397ba00177d4f92ce | [
"MIT"
] | 1 | 2019-08-07T03:16:47.000Z | 2019-08-07T03:16:47.000Z | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 5 12:41:09 2017
@author: lracuna
"""
#!/usr/bin/env python
"""
This program uses a simple implementation of the ADMM algorithm to solve
the circle packing problem.
We solve
minimize 1
subject to |x_i - x_j| > 2R,
R < x_i, ... | 31.665025 | 79 | 0.549471 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,245 | 0.349253 |
fbc1e336b5068fcf3a34a0e6490251bfd7d85954 | 7,658 | py | Python | models/train/train_seq2seq.py | Chucooleg/alfred | 250cdc8b1e75dd6acb9e20d3c616beec63307a46 | [
"MIT"
] | 1 | 2021-07-19T01:58:51.000Z | 2021-07-19T01:58:51.000Z | models/train/train_seq2seq.py | Chucooleg/alfred | 250cdc8b1e75dd6acb9e20d3c616beec63307a46 | [
"MIT"
] | null | null | null | models/train/train_seq2seq.py | Chucooleg/alfred | 250cdc8b1e75dd6acb9e20d3c616beec63307a46 | [
"MIT"
] | null | null | null | import os
import sys
import random
sys.path.append(os.path.join(os.environ['ALFRED_ROOT']))
sys.path.append(os.path.join(os.environ['ALFRED_ROOT'], 'models'))
import torch
import pprint
import json
from data.preprocess import Dataset
from importlib import import_module
from argparse import ArgumentDefaultsHelpFormatte... | 53.180556 | 152 | 0.69953 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,988 | 0.39018 |
fbc201d1881ba8593f71b1f223ddd8ebc3cad88f | 474 | py | Python | tests/search_test.py | martingaston/billy-search | 60bdfa0cf740675c3afd86ad68f83755c9cd6596 | [
"MIT"
] | null | null | null | tests/search_test.py | martingaston/billy-search | 60bdfa0cf740675c3afd86ad68f83755c9cd6596 | [
"MIT"
] | 17 | 2018-11-28T19:20:01.000Z | 2019-01-06T18:00:58.000Z | tests/search_test.py | martingaston/billy-search | 60bdfa0cf740675c3afd86ad68f83755c9cd6596 | [
"MIT"
] | null | null | null | import pytest
from billy.utils.search import google_book_search
class TestGoogleBookSearch(object):
def test_search_returns_200(self, mock):
"""Ensure a basic search returns a 200 request"""
assert google_book_search("Harry Potter")["status"] == 200
def test_search_body_returns_dict(self, moc... | 36.461538 | 77 | 0.721519 | 407 | 0.85865 | 0 | 0 | 0 | 0 | 0 | 0 | 160 | 0.337553 |
fbc22fb24183b91ed5d90aa53daf5acd378bad49 | 2,981 | py | Python | src/config.py | Clloud/MostPopularRoute | fd89c103b1635e4028913263fb667949d35c3986 | [
"MIT"
] | 7 | 2019-08-22T06:34:02.000Z | 2021-12-20T00:00:36.000Z | src/config.py | Clloud/MostPopularRoute | fd89c103b1635e4028913263fb667949d35c3986 | [
"MIT"
] | null | null | null | src/config.py | Clloud/MostPopularRoute | fd89c103b1635e4028913263fb667949d35c3986 | [
"MIT"
] | 2 | 2022-01-15T11:48:57.000Z | 2022-02-10T05:24:38.000Z | import math
class Config_1:
DATASET_ROOT_DIR = '../data/test1/Data' # The data set root directory
DATASET_SCALE = 0 # How many users' trajectory data are choosed
TRAJACTORY_SCALE = 20 # How many trajectories are choosed per user
RANGE = { # To... | 40.835616 | 85 | 0.578665 | 2,974 | 0.992657 | 0 | 0 | 0 | 0 | 0 | 0 | 1,153 | 0.384846 |
fbc2e6fec230818b054f8a5d8e0894e49655314a | 766 | py | Python | Python/first01.py | praseedpai/WhetYourApettite | d71780f5b52401eea71e631ba030270fca5d6005 | [
"MIT"
] | null | null | null | Python/first01.py | praseedpai/WhetYourApettite | d71780f5b52401eea71e631ba030270fca5d6005 | [
"MIT"
] | null | null | null | Python/first01.py | praseedpai/WhetYourApettite | d71780f5b52401eea71e631ba030270fca5d6005 | [
"MIT"
] | null | null | null | import sys
from sys import exit
if len(sys.argv) == 1 :
print ("No command line argument" )
sys.exit()
#else :
# print ("rest of the program ")
#numbers = sys.argv[1:]
#print (sorted(numbers, key=lambda x: float(x)))
numbers = []
i=1
n= len(sys.argv)
while ( i < n ):
numbers.append(sys.argv[i])
i=i+1
... | 15.632653 | 67 | 0.590078 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 336 | 0.438642 |
fbc2ffbc7159afa22106299ea24d3e4ca2b28846 | 4,553 | py | Python | library/gui.py | bwbryant1/Library | be8f9bb4fef448ca8630cdae36136bf16b691412 | [
"MIT"
] | null | null | null | library/gui.py | bwbryant1/Library | be8f9bb4fef448ca8630cdae36136bf16b691412 | [
"MIT"
] | null | null | null | library/gui.py | bwbryant1/Library | be8f9bb4fef448ca8630cdae36136bf16b691412 | [
"MIT"
] | null | null | null | from . import dbFuncs
import sys, os
import pkg_resources
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication, qApp, QHBoxLayout, QMainWindow, QAction, QMessageBox, QFileDialog, QPushButton
from PyQt5.QtGui import QIcon
class MainWindow(QMainWindow):
def __init__(self):
super(MainWindow,se... | 36.717742 | 143 | 0.648144 | 4,038 | 0.886888 | 0 | 0 | 0 | 0 | 0 | 0 | 795 | 0.17461 |
fbc4f59dc823de1070c620320ec7ff2dee6fbd35 | 135 | py | Python | du/ps_utils.py | diogo149/doo | d83a1715fb9d4e5eac9f5d3d384a45cfc26fec2f | [
"MIT"
] | 1 | 2016-11-17T06:34:39.000Z | 2016-11-17T06:34:39.000Z | du/ps_utils.py | diogo149/doo | d83a1715fb9d4e5eac9f5d3d384a45cfc26fec2f | [
"MIT"
] | null | null | null | du/ps_utils.py | diogo149/doo | d83a1715fb9d4e5eac9f5d3d384a45cfc26fec2f | [
"MIT"
] | null | null | null | import os
import psutil
import time
def process_time():
p = psutil.Process(os.getpid())
return time.time() - p.create_time()
| 15 | 40 | 0.688889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fbc4fa09de1f509b411b286d8439548aa1647a45 | 544 | py | Python | config.py | Laikos38/rockopy | 3816ebb8466a27c65e76a387abc36c96df688ef7 | [
"CC0-1.0"
] | null | null | null | config.py | Laikos38/rockopy | 3816ebb8466a27c65e76a387abc36c96df688ef7 | [
"CC0-1.0"
] | null | null | null | config.py | Laikos38/rockopy | 3816ebb8466a27c65e76a387abc36c96df688ef7 | [
"CC0-1.0"
] | null | null | null | # =================================================
# SERVER CONFIGURATIONS
# =================================================
CLIENT_ID=''
CLIENT_SECRET=''
REDIRECT_URI='http://ROCKOPY/'
# =================================================
# SERVER CONFIGURATIONS
# =================================================
S... | 24.727273 | 51 | 0.318015 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 436 | 0.801471 |
fbc9208f2d120f0ad2e9b2264fc8cd7812726bef | 1,356 | py | Python | upcfcardsearch/c269.py | ProfessorSean/Kasutamaiza | 7a69a69258f67bbb88bebbac6da4e6e1434947e6 | [
"MIT"
] | null | null | null | upcfcardsearch/c269.py | ProfessorSean/Kasutamaiza | 7a69a69258f67bbb88bebbac6da4e6e1434947e6 | [
"MIT"
] | null | null | null | upcfcardsearch/c269.py | ProfessorSean/Kasutamaiza | 7a69a69258f67bbb88bebbac6da4e6e1434947e6 | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
from discord.utils import get
class c269(commands.Cog, name="c269"):
def __init__(self, bot: commands.Bot):
self.bot = bot
@commands.command(name='Vir_the_True_Elementalist', aliases=['c269', 'Elementalist_1', 'Distasta_Master_1'])
async def exam... | 56.5 | 348 | 0.702802 | 1,219 | 0.898968 | 0 | 0 | 1,109 | 0.817847 | 992 | 0.731563 | 632 | 0.466077 |
fbc9265e10993b34830de5472d64bcc90ad75783 | 6,116 | py | Python | test/method_comparison.py | kiyami/stad | 492f5d4467553159ba11a17e46bae43e19fd7b6a | [
"MIT"
] | 2 | 2020-03-21T20:36:20.000Z | 2021-09-02T20:02:17.000Z | test/method_comparison.py | kiyami/stad | 492f5d4467553159ba11a17e46bae43e19fd7b6a | [
"MIT"
] | null | null | null | test/method_comparison.py | kiyami/stad | 492f5d4467553159ba11a17e46bae43e19fd7b6a | [
"MIT"
] | null | null | null | from soad import AsymmetricData as asyd
import matplotlib.pyplot as plt
# This script is prepared for showing the difference between methods of handling asymmetric errors.
class Data:
control_variable_parameters = [10.0, 1.0, 1.0]
control_variable = []
variable_list = []
def __init__(self, mu, sigm... | 29.980392 | 149 | 0.641269 | 5,040 | 0.823933 | 0 | 0 | 4,307 | 0.704103 | 0 | 0 | 387 | 0.063266 |
fbca8cfcb196a659d097cf5eeb8837d15ab42525 | 3,211 | py | Python | python/ex4/ex4.py | SHIMengjie/Machine-Learning-Andrew-Ng-Matlab | 2f54790e33dc538aea1534f40342791fb7c3abb1 | [
"MIT"
] | 6 | 2017-12-27T04:47:18.000Z | 2018-03-02T14:28:38.000Z | python/ex4/ex4.py | SHIMengjie/Machine-Learning-Andrew-Ng-Matlab | 2f54790e33dc538aea1534f40342791fb7c3abb1 | [
"MIT"
] | null | null | null | python/ex4/ex4.py | SHIMengjie/Machine-Learning-Andrew-Ng-Matlab | 2f54790e33dc538aea1534f40342791fb7c3abb1 | [
"MIT"
] | 2 | 2018-05-31T08:04:40.000Z | 2018-08-26T13:37:21.000Z | import scipy.io as scio
import numpy as np
import matplotlib.pyplot as plt
import scipy.optimize as opt
from displayData import display_data
from costFunction import nn_cost_function
from sigmoid import sigmoid_gradient
from randInitializeWeights import rand_init_weights
from checkNNGradients import check_nn_gradients... | 39.158537 | 150 | 0.690439 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,531 | 0.429935 |
fbca957948e0eda8e87f337b852c488037b3df59 | 2,432 | py | Python | examples/complex_filtering.py | ITgladiator/tortoise-orm | 9a2bd0edd078ae12e5837c22f88c19f8cc84e7d7 | [
"Apache-2.0"
] | null | null | null | examples/complex_filtering.py | ITgladiator/tortoise-orm | 9a2bd0edd078ae12e5837c22f88c19f8cc84e7d7 | [
"Apache-2.0"
] | 5 | 2020-03-24T17:23:14.000Z | 2021-12-13T20:12:49.000Z | examples/complex_filtering.py | ITgladiator/tortoise-orm | 9a2bd0edd078ae12e5837c22f88c19f8cc84e7d7 | [
"Apache-2.0"
] | null | null | null | """
This example shows some more complex querying
Key points are filtering by related names and using Q objects
"""
import asyncio
from tortoise import Tortoise, fields
from tortoise.models import Model
from tortoise.query_utils import Q
class Tournament(Model):
id = fields.IntField(pk=True)
name = fields.T... | 27.022222 | 91 | 0.701891 | 600 | 0.246711 | 0 | 0 | 0 | 0 | 1,480 | 0.608553 | 331 | 0.136102 |
fbcb4e1d16ab428716daad73e4a82b2e4b6883b2 | 3,012 | py | Python | igmp/packet/PacketIpHeader.py | pedrofran12/igmp | fec8d366536cbe10b0fe1c14f6a82cd03fe0772a | [
"MIT"
] | 3 | 2020-08-07T21:26:09.000Z | 2021-06-12T10:21:41.000Z | igmp/packet/PacketIpHeader.py | pedrofran12/igmp | fec8d366536cbe10b0fe1c14f6a82cd03fe0772a | [
"MIT"
] | 2 | 2021-08-25T14:58:54.000Z | 2022-01-26T12:00:13.000Z | igmp/packet/PacketIpHeader.py | pedrofran12/igmp | fec8d366536cbe10b0fe1c14f6a82cd03fe0772a | [
"MIT"
] | 3 | 2022-01-24T12:59:00.000Z | 2022-03-25T14:28:56.000Z | import struct
import socket
class PacketIpHeader:
"""
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version|
+-+-+-+-+
"""
IP_HDR = "! B"... | 33.098901 | 92 | 0.404714 | 2,931 | 0.973108 | 0 | 0 | 988 | 0.328021 | 0 | 0 | 1,621 | 0.538181 |
fbcbce60af2ea40ef9771cd4e2bb6d4016db9a38 | 1,547 | py | Python | shopping_mall/shopping_mall/utils/fastdfs/fdfs_storage.py | lzy00001/SHOP_CENTER | 1e26b9694afc89d86f2f3db9c0b0ff1f98ab1369 | [
"MIT"
] | null | null | null | shopping_mall/shopping_mall/utils/fastdfs/fdfs_storage.py | lzy00001/SHOP_CENTER | 1e26b9694afc89d86f2f3db9c0b0ff1f98ab1369 | [
"MIT"
] | null | null | null | shopping_mall/shopping_mall/utils/fastdfs/fdfs_storage.py | lzy00001/SHOP_CENTER | 1e26b9694afc89d86f2f3db9c0b0ff1f98ab1369 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.core.files.storage import Storage
from django.utils.deconstruct import deconstructible
from fdfs_client.client import Fdfs_client
@deconstructible
class FastDFSStorage(Storage):
def __init__(self, base_url=None, client_conf=None):
"""
初始化
:param... | 26.672414 | 56 | 0.599871 | 1,628 | 0.893033 | 0 | 0 | 1,645 | 0.902359 | 0 | 0 | 861 | 0.472298 |
fbcc3437214daafca043a3fde76d32524788bacf | 664 | py | Python | src/sovereign/server.py | bochuxt/envoy-control-plane-python3 | 6d63ad6e1ecff5365bb571f0021951b066f8e270 | [
"Apache-2.0"
] | 1 | 2020-07-08T19:37:09.000Z | 2020-07-08T19:37:09.000Z | src/sovereign/server.py | bochuxt/envoy-control-plane-python3 | 6d63ad6e1ecff5365bb571f0021951b066f8e270 | [
"Apache-2.0"
] | null | null | null | src/sovereign/server.py | bochuxt/envoy-control-plane-python3 | 6d63ad6e1ecff5365bb571f0021951b066f8e270 | [
"Apache-2.0"
] | null | null | null | import gunicorn.app.base
from sovereign import asgi_config
from sovereign.app import app
class StandaloneApplication(gunicorn.app.base.BaseApplication):
def __init__(self, application, options=None):
self.options = options or {}
self.application = application
super().__init__()
def lo... | 22.133333 | 63 | 0.661145 | 391 | 0.588855 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 0.01506 |
fbceb552efb8ef0ad3ab8ba19aa7104619c9f206 | 495 | py | Python | Python/CeV/Exercicios/ex71.py | WerickL/Learning | 5a9a488f0422454e612439b89093d5bc11242e65 | [
"MIT"
] | null | null | null | Python/CeV/Exercicios/ex71.py | WerickL/Learning | 5a9a488f0422454e612439b89093d5bc11242e65 | [
"MIT"
] | null | null | null | Python/CeV/Exercicios/ex71.py | WerickL/Learning | 5a9a488f0422454e612439b89093d5bc11242e65 | [
"MIT"
] | null | null | null | Val = int(input('Digite o valor que você quer sacar:'))
c50 = c20 = c10 = c1 = 0
if Val // 50 != 0:
c50 = Val // 50
Val = Val % 50
if Val // 20 != 0:
c20 = Val // 20
Val = Val % 20
if Val // 10 != 0:
c10 = Val // 10
Val = Val % 10
if Val // 1 != 0:
c1 = Val // 1
if c50 != 0:
print(f'{c50... | 23.571429 | 55 | 0.50303 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 148 | 0.296 |
fbd0e3db5f9cf99e22751e706aab58c1843471e9 | 801 | bzl | Python | model/oppia_proto_library.bzl | bhaktideshmukh/oppia-android | 94626909570ddbbd06d2cd691b49f357b986db0f | [
"Apache-2.0"
] | null | null | null | model/oppia_proto_library.bzl | bhaktideshmukh/oppia-android | 94626909570ddbbd06d2cd691b49f357b986db0f | [
"Apache-2.0"
] | null | null | null | model/oppia_proto_library.bzl | bhaktideshmukh/oppia-android | 94626909570ddbbd06d2cd691b49f357b986db0f | [
"Apache-2.0"
] | null | null | null | """
Bazel macros for defining proto libraries.
"""
load("@rules_proto//proto:defs.bzl", "proto_library")
# TODO(#4096): Remove this once it's no longer needed.
def oppia_proto_library(name, **kwargs):
"""
Defines a new proto library.
Note that the library is defined with a stripped import prefix which en... | 30.807692 | 99 | 0.689139 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 647 | 0.80774 |
fbd1627e659fe085f390ad7f199095412b24f0f3 | 1,533 | py | Python | tests/test_cbers_ndvi.py | RemotePixel/remotepixel-py | bd58db7a394c84651d05c4e6f83da4cd3d4c26f3 | [
"BSD-2-Clause"
] | 5 | 2017-09-29T15:21:39.000Z | 2021-02-23T02:03:18.000Z | tests/test_cbers_ndvi.py | RemotePixel/remotepixel-py | bd58db7a394c84651d05c4e6f83da4cd3d4c26f3 | [
"BSD-2-Clause"
] | 3 | 2017-11-03T13:24:31.000Z | 2018-09-18T13:55:52.000Z | tests/test_cbers_ndvi.py | RemotePixel/remotepixel-py | bd58db7a394c84651d05c4e6f83da4cd3d4c26f3 | [
"BSD-2-Clause"
] | 4 | 2017-10-04T10:42:45.000Z | 2019-06-21T07:49:35.000Z |
import os
from remotepixel import cbers_ndvi
CBERS_SCENE = "CBERS_4_MUX_20171121_057_094_L2"
CBERS_BUCKET = os.path.join(os.path.dirname(__file__), "fixtures", "cbers-pds")
CBERS_PATH = os.path.join(
CBERS_BUCKET, "CBERS4/MUX/057/094/CBERS_4_MUX_20171121_057_094_L2/"
)
def test_point_valid(monkeypatch):
""... | 36.5 | 83 | 0.692107 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 511 | 0.333333 |
fbd2de928f07cf44790d6956008e6625c654e85c | 2,270 | py | Python | test/scons-time/time/no-result.py | moroten/scons | 20927b42ed4f0cb87f51287fa3b4b6cf915afcf8 | [
"MIT"
] | 1,403 | 2017-11-23T14:24:01.000Z | 2022-03-30T20:59:39.000Z | test/scons-time/time/no-result.py | moroten/scons | 20927b42ed4f0cb87f51287fa3b4b6cf915afcf8 | [
"MIT"
] | 3,708 | 2017-11-27T13:47:12.000Z | 2022-03-29T17:21:17.000Z | test/scons-time/time/no-result.py | moroten/scons | 20927b42ed4f0cb87f51287fa3b4b6cf915afcf8 | [
"MIT"
] | 281 | 2017-12-01T23:48:38.000Z | 2022-03-31T15:25:44.000Z | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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, publish,
... | 27.682927 | 73 | 0.711013 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,653 | 0.728194 |
fbd3456398088e022605db823242b0036ee40344 | 25,955 | py | Python | alipy/index/index_collections.py | Houchaoqun/ALiPy | 93aff0379db2a1994803d19026c434c2b12a2485 | [
"BSD-3-Clause"
] | 1 | 2019-07-10T10:55:18.000Z | 2019-07-10T10:55:18.000Z | alipy/index/index_collections.py | Houchaoqun/ALiPy | 93aff0379db2a1994803d19026c434c2b12a2485 | [
"BSD-3-Clause"
] | null | null | null | alipy/index/index_collections.py | Houchaoqun/ALiPy | 93aff0379db2a1994803d19026c434c2b12a2485 | [
"BSD-3-Clause"
] | null | null | null | """
The container to store indexes in active learning.
Serve as the basic type of 'set' operation.
"""
# Authors: Ying-Peng Tang
# License: BSD 3 clause
from __future__ import division
import collections
import copy
import numpy as np
from .multi_label_tools import check_index_multilabel, infer_label_size_multilabe... | 36.607898 | 124 | 0.571335 | 24,045 | 0.926411 | 0 | 0 | 3,195 | 0.123098 | 0 | 0 | 15,268 | 0.588249 |
fbd3b3b8ed744c1417f498327a5a9678f19a086e | 327 | py | Python | keycache/util.py | psytron/keycache | 0b69e21719dbe76908476c01e3e487aae2612fd2 | [
"Apache-2.0"
] | 2 | 2020-04-27T07:48:54.000Z | 2020-10-21T17:47:54.000Z | keycache/util.py | psytron/keycache | 0b69e21719dbe76908476c01e3e487aae2612fd2 | [
"Apache-2.0"
] | null | null | null | keycache/util.py | psytron/keycache | 0b69e21719dbe76908476c01e3e487aae2612fd2 | [
"Apache-2.0"
] | null | null | null | import platform as p
import uuid
import hashlib
def basic():
sb = []
sb.append(p.node())
sb.append( ''.join([ x for x in p.architecture() ]) )
sb.append(p.machine())
sb.append(p.processor())
sb.append(p.system())
sb.append(str(uuid.getnode())) # MAC address
text = '.'.join(sb)
retu... | 21.8 | 57 | 0.599388 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 18 | 0.055046 |
fbd4db8145e5a07f88303ba81f436838785ffa65 | 995 | py | Python | the biggidy back end/rawText.py | jlekas/recipe-site | e1c54cb0c19e2c28a968abe8988d7b57fdadbb46 | [
"MIT"
] | 1 | 2019-09-06T00:16:27.000Z | 2019-09-06T00:16:27.000Z | the biggidy back end/rawText.py | jlekas/recipe-site | e1c54cb0c19e2c28a968abe8988d7b57fdadbb46 | [
"MIT"
] | 6 | 2021-03-09T17:29:30.000Z | 2022-02-26T17:43:15.000Z | the biggidy back end/rawText.py | jlekas/recipe-site | e1c54cb0c19e2c28a968abe8988d7b57fdadbb46 | [
"MIT"
] | null | null | null | url = "https://www.delish.com/cooking/recipe-ideas/recipes/a53823/easy-pad-thai-recipe/"
url2 = "https://www.allrecipes.com/recipe/92462/slow-cooker-texas-pulled-pork/"
# opener = urllib.URLopener()
# opener.addheader(('User-Agent', 'Mozilla/5.0'))
# f = urllib.urlopen(url)
import requests
import html2text
h = html2... | 20.729167 | 88 | 0.613065 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 532 | 0.534673 |
fbd4f0ccd22a107526cc04a4572d5b45f8b8bf9b | 21,796 | py | Python | tests/test_service_desk.py | p-tombez/jira | a2d9311aa81384382cb3cbe6c9a6bc8f56387feb | [
"BSD-2-Clause"
] | null | null | null | tests/test_service_desk.py | p-tombez/jira | a2d9311aa81384382cb3cbe6c9a6bc8f56387feb | [
"BSD-2-Clause"
] | null | null | null | tests/test_service_desk.py | p-tombez/jira | a2d9311aa81384382cb3cbe6c9a6bc8f56387feb | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
import inspect
import logging
import os
import platform
import sys
from time import sleep
from flaky import flaky
import pytest
import requests
from jira_test_manager import JiraTestManager
# _non_parallel is used to prevent some tests from failing due to ... | 38.991055 | 117 | 0.677097 | 18,978 | 0.87071 | 0 | 0 | 19,003 | 0.871857 | 0 | 0 | 2,578 | 0.118279 |
fbd4f1c85388584979a3225e172df289b9b181ba | 1,761 | py | Python | mods/goofile.py | Natto97/discover | 101d5457bad9345598720a49e4323b047030e496 | [
"MIT"
] | 1 | 2018-08-11T10:28:00.000Z | 2018-08-11T10:28:00.000Z | mods/goofile.py | Natto97/discover | 101d5457bad9345598720a49e4323b047030e496 | [
"MIT"
] | null | null | null | mods/goofile.py | Natto97/discover | 101d5457bad9345598720a49e4323b047030e496 | [
"MIT"
] | 1 | 2018-11-02T18:33:00.000Z | 2018-11-02T18:33:00.000Z | #!/usr/bin/env python
# Goofile v1.5a
# by Thomas (G13) Richards
# www.g13net.com
# Project Page: code.google.com/p/goofile
# TheHarvester used for inspiration
# A many thanks to the Edge-Security team!
# Modified by Lee Baird
import getopt
import httplib
import re
import string
import sys
global result
r... | 20.717647 | 71 | 0.609313 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 626 | 0.35548 |
fbd4fbdd0e8caf1bb4e01991f3ba92b60968ec1e | 211 | py | Python | Atividade do Livro-Nilo Ney(PYTHON)/Cap.05/exe 5.25.py | EduardoJonathan0/Python | 0e4dff4703515a6454ba25c6f401960b6155f32f | [
"MIT"
] | null | null | null | Atividade do Livro-Nilo Ney(PYTHON)/Cap.05/exe 5.25.py | EduardoJonathan0/Python | 0e4dff4703515a6454ba25c6f401960b6155f32f | [
"MIT"
] | null | null | null | Atividade do Livro-Nilo Ney(PYTHON)/Cap.05/exe 5.25.py | EduardoJonathan0/Python | 0e4dff4703515a6454ba25c6f401960b6155f32f | [
"MIT"
] | null | null | null | n = int(input('Insira um número e calcule sua raiz: '))
b = 2
while True:
p = (b + (n / b)) / 2
res = p ** 2
b = p
if abs(n - res) < 0.0001:
break
print(f'p = {p}')
print(f'p² = {res}')
| 17.583333 | 55 | 0.469194 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 64 | 0.300469 |
fbd741a2b97e35d13af8722f7601c0365f0d7506 | 1,732 | py | Python | wolframclient/utils/six.py | krbarker/WolframClientForPython | f2198b15cad0f406b78ad40a4d1e3ca76125b408 | [
"MIT"
] | null | null | null | wolframclient/utils/six.py | krbarker/WolframClientForPython | f2198b15cad0f406b78ad40a4d1e3ca76125b408 | [
"MIT"
] | null | null | null | wolframclient/utils/six.py | krbarker/WolframClientForPython | f2198b15cad0f406b78ad40a4d1e3ca76125b408 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import datetime
import decimal
import platform
import sys
import types
from itertools import chain
#stripped version of SIX
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
PY_35 = sys.version_info >= (3, 5... | 25.850746 | 79 | 0.691686 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 299 | 0.172633 |
fbd89ae0e3bc378776e8ecafb307ef98cc2d28f8 | 3,388 | py | Python | Lib/site-packages/pynput/mouse/_xorg.py | djaldave/laevad-python-2.7.18 | df9aac191d554295db45d638e528880a9ab9a3ec | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/pynput/mouse/_xorg.py | djaldave/laevad-python-2.7.18 | df9aac191d554295db45d638e528880a9ab9a3ec | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/pynput/mouse/_xorg.py | djaldave/laevad-python-2.7.18 | df9aac191d554295db45d638e528880a9ab9a3ec | [
"bzip2-1.0.6"
] | null | null | null | # coding=utf-8
# pynput
# Copyright (C) 2015-2016 Moses Palmér
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option) any
# later version.
... | 30.522523 | 79 | 0.631641 | 2,502 | 0.738271 | 0 | 0 | 0 | 0 | 0 | 0 | 935 | 0.275893 |
fbdc68b03f388458c541749b935a1b91cef73dc0 | 155,379 | py | Python | automate_online-materials/census2010.py | kruschk/automate-the-boring-stuff | 2172fa9d1846b2ba9ead4e86971d72edd54f97b3 | [
"MIT"
] | 2 | 2020-01-18T16:01:24.000Z | 2020-02-29T19:27:17.000Z | automate_online-materials/census2010.py | kruschk/automate-the-boring-stuff | 2172fa9d1846b2ba9ead4e86971d72edd54f97b3 | [
"MIT"
] | 88 | 2019-10-31T12:30:02.000Z | 2020-08-14T12:17:12.000Z | automate_online-materials/census2010.py | kruschk/automate-the-boring-stuff | 2172fa9d1846b2ba9ead4e86971d72edd54f97b3 | [
"MIT"
] | 4 | 2020-08-17T16:49:06.000Z | 2022-02-14T06:45:29.000Z | allData = {'AK': {'Aleutians East': {'pop': 3141, 'tracts': 1},
'Aleutians West': {'pop': 5561, 'tracts': 2},
'Anchorage': {'pop': 291826, 'tracts': 55},
'Bethel': {'pop': 17013, 'tracts': 3},
'Bristol Bay': {'pop': 997, 'tracts': 1},
'Denali': {'pop': 1826, 'tracts': 1},
... | 49.436526 | 65 | 0.452481 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 69,441 | 0.446914 |
fbdc81d7845fea02b2d263cc5ca73eecc6dfae8e | 2,259 | py | Python | piecutter/engines/mock.py | diecutter/piecutter | 250a90a4cae1b72ff3c141dffb8c58de74dbedfd | [
"BSD-3-Clause"
] | 2 | 2016-05-02T02:22:34.000Z | 2021-02-08T18:17:30.000Z | piecutter/engines/mock.py | diecutter/piecutter | 250a90a4cae1b72ff3c141dffb8c58de74dbedfd | [
"BSD-3-Clause"
] | 2 | 2016-03-22T10:09:13.000Z | 2016-07-01T08:04:43.000Z | piecutter/engines/mock.py | diecutter/piecutter | 250a90a4cae1b72ff3c141dffb8c58de74dbedfd | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Mock template engine, for use in tests."""
from piecutter.engines import Engine
#: Default value used as :py:attr:`MockEngine.render_result`
default_render_result = u'RENDER WITH ARGS={args!s} AND KWARGS={kwargs!s}'
class MockEngine(Engine):
"""Template engine mock.
Typical usage... | 31.375 | 77 | 0.626826 | 2,011 | 0.890217 | 0 | 0 | 0 | 0 | 0 | 0 | 1,687 | 0.746791 |
fbdcdec6f6daabaf8ab83907c267233eb37da60d | 4,276 | py | Python | Groups/Group_ID_18/CWMVFE.py | shekhar-sharma/DataScience | 1fd771f873a9bc0800458fd7c05e228bb6c4e8a0 | [
"MIT"
] | 5 | 2020-12-13T07:53:22.000Z | 2020-12-20T18:49:27.000Z | Groups/Group_ID_18/CWMVFE.py | Gulnaz-Tabassum/DataScience | 1fd771f873a9bc0800458fd7c05e228bb6c4e8a0 | [
"MIT"
] | null | null | null | Groups/Group_ID_18/CWMVFE.py | Gulnaz-Tabassum/DataScience | 1fd771f873a9bc0800458fd7c05e228bb6c4e8a0 | [
"MIT"
] | 24 | 2020-12-12T11:23:28.000Z | 2021-10-04T13:09:38.000Z | #MCCA (Multiview Canonical Correlation Analysis)
import numpy as np
from scipy import linalg as lin
from sklearn.preprocessing import StandardScaler
from sklearn.neighbors import KNeighborsClassifier
class CWMVFE:
def __init__(self,n_components=2,reg_param=0.01 , L):
self.n_components = n_component... | 32.641221 | 149 | 0.563143 | 1,948 | 0.455459 | 0 | 0 | 0 | 0 | 0 | 0 | 545 | 0.127426 |
fbddad4ad03be76385839104dc7ae9091a1e919e | 1,331 | py | Python | scripts/lda.py | flatironinstitute/catvae | 4bfdce83a24c0fb0e55215dd24cda5dcaa9d418a | [
"BSD-3-Clause"
] | 6 | 2021-05-23T18:50:48.000Z | 2022-02-23T20:57:36.000Z | scripts/lda.py | flatironinstitute/catvae | 4bfdce83a24c0fb0e55215dd24cda5dcaa9d418a | [
"BSD-3-Clause"
] | 24 | 2021-05-19T17:43:33.000Z | 2022-03-03T21:41:13.000Z | scripts/lda.py | mortonjt/catvae | 003a46682fc33e5b0d66c17e85e59e464a465c53 | [
"BSD-3-Clause"
] | 2 | 2021-05-19T16:21:13.000Z | 2021-09-23T01:11:29.000Z | import argparse
from sklearn.decomposition import LatentDirichletAllocation as LDA
import pickle
from biom import load_table
def main(args):
model = LDA(n_components=args.n_latent, max_iter=args.iterations,
verbose=1, learning_method='online')
table = load_table(args.train_biom)
X = table.... | 36.972222 | 76 | 0.596544 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 237 | 0.178062 |
fbdf88f92268a5b7f1908449c372b3ef7604c3eb | 2,984 | py | Python | splitjoin.py | sonicskye/senarai | 1d531372b9d290812df97c2be644fe1d4d4ffb1c | [
"MIT"
] | 1 | 2018-12-31T02:55:26.000Z | 2018-12-31T02:55:26.000Z | splitjoin.py | sonicskye/senarai | 1d531372b9d290812df97c2be644fe1d4d4ffb1c | [
"MIT"
] | null | null | null | splitjoin.py | sonicskye/senarai | 1d531372b9d290812df97c2be644fe1d4d4ffb1c | [
"MIT"
] | null | null | null | '''
splitjoin.py
sonicskye@2018
The functions are used to split and join files
based on:
https://stonesoupprogramming.com/2017/09/16/python-split-and-join-file/
with modification by adding natural sort
'''
import os
import re
# https://stackoverflow.com/questions/11150239/python-natural-sorting
def natural_s... | 25.724138 | 79 | 0.647118 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,487 | 0.498324 |
fbdfcde9b6324f3991c172b4af39c20e74cff120 | 9,653 | py | Python | daily_leader_board.py | bundgus/hadoop-yarn-resource-consumption-report | 92ef200b4dbd5fd9d7877817b72d4d407126896f | [
"MIT"
] | 1 | 2019-04-29T18:32:19.000Z | 2019-04-29T18:32:19.000Z | daily_leader_board.py | bundgus/hadoop-yarn-resource-consumption-report | 92ef200b4dbd5fd9d7877817b72d4d407126896f | [
"MIT"
] | null | null | null | daily_leader_board.py | bundgus/hadoop-yarn-resource-consumption-report | 92ef200b4dbd5fd9d7877817b72d4d407126896f | [
"MIT"
] | null | null | null | # Mark Bundgus 2019
import luigi
import logging
from yarn_api_client import ResourceManager # https://python-client-for-hadoop-yarn-api.readthedocs.io
from datetime import datetime
from datetime import timedelta
import pandas as pd
from tabulate import tabulate
import os
import configuration
log = logging.getLogger("... | 43.09375 | 114 | 0.58531 | 9,266 | 0.959909 | 0 | 0 | 0 | 0 | 0 | 0 | 2,461 | 0.254947 |
fbdfdcb0c2a9cd822c60b6faedf5d56ff354a6c6 | 1,071 | py | Python | bfxhfindicators/wma.py | quadramadery/bfx-hf-indicators-py | fe523607ae6c16fc26f1bb1d5e8062a3770b43e4 | [
"Apache-2.0"
] | 1 | 2022-01-12T09:31:45.000Z | 2022-01-12T09:31:45.000Z | bfxhfindicators/wma.py | quadramadery/bfx-hf-indicators-py | fe523607ae6c16fc26f1bb1d5e8062a3770b43e4 | [
"Apache-2.0"
] | null | null | null | bfxhfindicators/wma.py | quadramadery/bfx-hf-indicators-py | fe523607ae6c16fc26f1bb1d5e8062a3770b43e4 | [
"Apache-2.0"
] | null | null | null | from bfxhfindicators.indicator import Indicator
class WMA(Indicator):
def __init__(self, args = []):
[ period ] = args
d = 0
for i in range(period):
d += (i + 1)
self._d = d
self._p = period
self._buffer = []
super().__init__({
'args': args,
'id': 'wma',
'name'... | 18.152542 | 47 | 0.519141 | 1,021 | 0.953315 | 0 | 0 | 0 | 0 | 0 | 0 | 43 | 0.040149 |
fbe1cc6565e4765aae8322647fc0bb9752036f7c | 5,021 | py | Python | src/scripts/train_image.py | paavalipopov/introspection | ee486a9e8c8b6ddb7ab257eae9e14aac5d637527 | [
"Apache-2.0"
] | null | null | null | src/scripts/train_image.py | paavalipopov/introspection | ee486a9e8c8b6ddb7ab257eae9e14aac5d637527 | [
"Apache-2.0"
] | null | null | null | src/scripts/train_image.py | paavalipopov/introspection | ee486a9e8c8b6ddb7ab257eae9e14aac5d637527 | [
"Apache-2.0"
] | null | null | null | import argparse
from datetime import datetime
import os
from catalyst import dl, utils
from catalyst.contrib.data import AllTripletsSampler
from catalyst.contrib.losses import TripletMarginLossWithSampler
from catalyst.data import BatchBalanceClassSampler
from torch import nn, optim
from torch.utils.data import DataLo... | 31.778481 | 92 | 0.601075 | 465 | 0.092611 | 0 | 0 | 0 | 0 | 0 | 0 | 568 | 0.113125 |
836bc2bf5ec4d2f69e9599977608bd55913a2fd3 | 22,536 | py | Python | aegea/batch.py | MrOlm/aegea | 5599ddaf7947918a5c7a0282ab993cfa304790f8 | [
"Apache-2.0"
] | null | null | null | aegea/batch.py | MrOlm/aegea | 5599ddaf7947918a5c7a0282ab993cfa304790f8 | [
"Apache-2.0"
] | null | null | null | aegea/batch.py | MrOlm/aegea | 5599ddaf7947918a5c7a0282ab993cfa304790f8 | [
"Apache-2.0"
] | null | null | null | """
Manage AWS Batch jobs, queues, and compute environments.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import os, sys, argparse, base64, collections, io, subprocess, json, time, re, hashlib, concurrent.futures, itertools
from botocore.exceptions import ClientError
from .... | 57.489796 | 120 | 0.693734 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5,378 | 0.23864 |
836c208587b33a187a0445b8a77d2420c941ff8d | 10,897 | py | Python | src/run_joint_confidence_generator-only.py | williamsashbee/Confident_classifier | cba3ef862b310afc3af6c4a62b524f032f45549e | [
"MIT"
] | null | null | null | src/run_joint_confidence_generator-only.py | williamsashbee/Confident_classifier | cba3ef862b310afc3af6c4a62b524f032f45549e | [
"MIT"
] | null | null | null | src/run_joint_confidence_generator-only.py | williamsashbee/Confident_classifier | cba3ef862b310afc3af6c4a62b524f032f45549e | [
"MIT"
] | null | null | null | ##############################################
# This code is based on samples from pytorch #
##############################################
# Writer: Kimin Lee
from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import d... | 35.727869 | 146 | 0.626962 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4,011 | 0.368083 |
836ce39bcde99da750d6f14d0f025be31157aa0f | 302 | py | Python | 450/Nagendra/greedy/Swap and Maximize .py | Nagendracse1/Competitive-Programming | 325e151b9259dbc31d331c8932def42e3ab09913 | [
"MIT"
] | 3 | 2020-12-20T10:23:11.000Z | 2021-06-16T10:34:18.000Z | 450/Nagendra/greedy/Swap and Maximize .py | Spring-dot/Competitive-Programming | 98add277a8b029710c749d1082de25c524e12408 | [
"MIT"
] | null | null | null | 450/Nagendra/greedy/Swap and Maximize .py | Spring-dot/Competitive-Programming | 98add277a8b029710c749d1082de25c524e12408 | [
"MIT"
] | null | null | null | #code https://practice.geeksforgeeks.org/problems/swap-and-maximize/0
for _ in range(int(input())):
n = int(input())
arr = list(map(int, input().split()))
arr.sort()
max = 0
for i in range(n//2):
max -= 2*arr[i]
max += 2*arr[n-i-1]
print(max) | 21.571429 | 69 | 0.523179 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 69 | 0.228477 |
836d607bb4f413a3224c84e9b615d0b74908dbb0 | 2,304 | py | Python | ga4stpg/tree/generate.py | GiliardGodoi/ppgi-stpg-gpx | 2097b086111e1cde423031c9a9d58f45b2b96353 | [
"MIT"
] | null | null | null | ga4stpg/tree/generate.py | GiliardGodoi/ppgi-stpg-gpx | 2097b086111e1cde423031c9a9d58f45b2b96353 | [
"MIT"
] | 5 | 2021-01-26T17:28:32.000Z | 2021-03-14T13:46:48.000Z | ga4stpg/tree/generate.py | GiliardGodoi/ppgi-stpg-gpx | 2097b086111e1cde423031c9a9d58f45b2b96353 | [
"MIT"
] | 1 | 2021-01-25T16:35:59.000Z | 2021-01-25T16:35:59.000Z | from random import sample, shuffle
from ga4stpg.graph import UGraph
from ga4stpg.graph.disjointsets import DisjointSets
class GenerateBasedPrimRST:
def __init__(self, stpg):
self.stpg = stpg
def __call__(self):
result = UGraph()
terminals = self.stpg.terminals.copy()
... | 27.105882 | 74 | 0.521267 | 2,163 | 0.938802 | 0 | 0 | 0 | 0 | 0 | 0 | 95 | 0.041233 |
83703f7128768cbf161b1e6803712f5beeb2dcb8 | 10,284 | py | Python | Probabilistic_Matching.py | Data-Linkage/Rwandan_linkage | 2c9e504b510f5ec54d207779e20b5ad491c4c5df | [
"MIT"
] | null | null | null | Probabilistic_Matching.py | Data-Linkage/Rwandan_linkage | 2c9e504b510f5ec54d207779e20b5ad491c4c5df | [
"MIT"
] | null | null | null | Probabilistic_Matching.py | Data-Linkage/Rwandan_linkage | 2c9e504b510f5ec54d207779e20b5ad491c4c5df | [
"MIT"
] | null | null | null | import pandas as pd
import rapidfuzz
import math
import numpy as np
# ------------------------- #
# --------- DATA ---------- #
# ------------------------- #
# Read in mock census and PES data
CEN = pd.read_csv('Data/Mock_Rwanda_Data_Census.csv')
PES = pd.read_csv('Data/Mock_Rwanda_Data_Pes.csv')
# select ne... | 46.533937 | 160 | 0.587417 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5,533 | 0.53802 |