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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
58bb3bdee68016c8f1865176bbbb0531b4055727 | 855 | py | Python | lintcode/1375.2.py | jianershi/algorithm | c3c38723b9c5f1cc745550d89e228f92fd4abfb2 | [
"MIT"
] | 1 | 2021-01-08T06:57:49.000Z | 2021-01-08T06:57:49.000Z | lintcode/1375.2.py | jianershi/algorithm | c3c38723b9c5f1cc745550d89e228f92fd4abfb2 | [
"MIT"
] | null | null | null | lintcode/1375.2.py | jianershi/algorithm | c3c38723b9c5f1cc745550d89e228f92fd4abfb2 | [
"MIT"
] | 1 | 2021-01-08T06:57:52.000Z | 2021-01-08T06:57:52.000Z | """
1375. Substring With At Least K Distinct Characters
"""
class Solution:
"""
@param s: a string
@param k: an integer
@return: the number of substrings there are that contain at least k distinct characters
"""
def kDistinctCharacters(self, s, k):
# Write your code here
n = len... | 28.5 | 91 | 0.512281 | 793 | 0.927485 | 0 | 0 | 0 | 0 | 0 | 0 | 232 | 0.271345 |
58bb7d04b96141208c9caee423f5f2553e1e7354 | 390 | py | Python | ex29_half.py | youknowone/learn-python3-thw-code-ko | 3b7fccaf3eed7427e437004cfe3c4908823f5e41 | [
"MIT"
] | null | null | null | ex29_half.py | youknowone/learn-python3-thw-code-ko | 3b7fccaf3eed7427e437004cfe3c4908823f5e41 | [
"MIT"
] | null | null | null | ex29_half.py | youknowone/learn-python3-thw-code-ko | 3b7fccaf3eed7427e437004cfe3c4908823f5e41 | [
"MIT"
] | null | null | null | people = 20
cats = 30
dogs = 15
if people < cats:
print("๊ณ ์์ด๊ฐ ๋๋ฌด ๋ง์์! ์ธ์์ ๋ฉธ๋งํฉ๋๋ค!")
if people > cats:
print("๊ณ ์์ด๊ฐ ๋ง์ง ์์์! ์ธ์์ ์ง์๋ฉ๋๋ค!")
if people < dogs:
print("์ธ์์ ์นจ์ ์ ์ต๋๋ค!")
if people > dogs:
print("์ธ์์ ๋ง๋์ต๋๋ค!")
dogs += 5
if people >= dogs:
print("์ฌ๋์ ๊ฐ๋ณด๋ค ๋ง๊ฑฐ๋ ๊ฐ์ต๋๋ค")
if people <= dogs:
p... | 13 | 36 | 0.584615 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 292 | 0.523297 |
58bbe52ab96a55b367459bffd53e878ab429b0e4 | 1,019 | py | Python | env/lib/python3.6/site-packages/traits/util/tests/test_import_symbol.py | Raniac/NEURO-LEARN | 3c3acc55de8ba741e673063378e6cbaf10b64c7a | [
"Apache-2.0"
] | 8 | 2019-05-29T09:38:30.000Z | 2021-01-20T03:36:59.000Z | env/lib/python3.6/site-packages/traits/util/tests/test_import_symbol.py | Raniac/neurolearn_dev | 3c3acc55de8ba741e673063378e6cbaf10b64c7a | [
"Apache-2.0"
] | 12 | 2021-03-09T03:01:16.000Z | 2022-03-11T23:59:36.000Z | env/lib/python3.6/site-packages/traits/util/tests/test_import_symbol.py | Raniac/NEURO-LEARN | 3c3acc55de8ba741e673063378e6cbaf10b64c7a | [
"Apache-2.0"
] | 1 | 2020-07-17T12:49:49.000Z | 2020-07-17T12:49:49.000Z | """ Tests for the import manager. """
from traits.util.api import import_symbol
from traits.testing.unittest_tools import unittest
class TestImportSymbol(unittest.TestCase):
""" Tests for the import manager. """
def test_import_dotted_symbol(self):
""" import dotted symbol """
import tarfi... | 22.644444 | 79 | 0.614328 | 753 | 0.73896 | 0 | 0 | 0 | 0 | 0 | 0 | 327 | 0.320903 |
58bc5c4ebc0423782cb9f4ff3dd73ea7e914bd8c | 7,692 | py | Python | cubecode/ไบ้ถๆฎต็ฎๆณๅ้/python็/RubiksCube-TwophaseSolver-master/client_gui.py | YuYuCong/Color-recognition-of-Rubik-s-Cube | 35d5af5383ed56d38e596983aaeda98540fdb646 | [
"CC0-1.0"
] | 11 | 2018-07-28T03:20:26.000Z | 2022-02-18T07:36:35.000Z | cubecode/ไบ้ถๆฎต็ฎๆณๅ้/python็/RubiksCube-TwophaseSolver-master/client_gui.py | technicianliu/Color-recognition-of-Rubik-s-Cube | 35d5af5383ed56d38e596983aaeda98540fdb646 | [
"CC0-1.0"
] | null | null | null | cubecode/ไบ้ถๆฎต็ฎๆณๅ้/python็/RubiksCube-TwophaseSolver-master/client_gui.py | technicianliu/Color-recognition-of-Rubik-s-Cube | 35d5af5383ed56d38e596983aaeda98540fdb646 | [
"CC0-1.0"
] | 9 | 2018-07-28T03:20:29.000Z | 2021-05-09T05:54:30.000Z | # ################ A simple graphical interface which communicates with the server #####################################
from tkinter import *
import socket
import face
import cubie
# ################################## some global variables and constants ###############################################
DEFAULT_HOST =... | 40.484211 | 120 | 0.518201 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,643 | 0.343604 |
58bc76fe979d8a17599711a8021f4425b357315a | 1,159 | py | Python | bootcamp/wiki/core/compat.py | basiltiger/easy_bootcamp | 875b9ed287f1a7824bb38f142dbe2f3b1ce54389 | [
"MIT"
] | null | null | null | bootcamp/wiki/core/compat.py | basiltiger/easy_bootcamp | 875b9ed287f1a7824bb38f142dbe2f3b1ce54389 | [
"MIT"
] | null | null | null | bootcamp/wiki/core/compat.py | basiltiger/easy_bootcamp | 875b9ed287f1a7824bb38f142dbe2f3b1ce54389 | [
"MIT"
] | null | null | null | """Abstraction layer to deal with Django related changes in order to keep
compatibility with several Django versions simultaneously."""
from __future__ import unicode_literals
from django.conf import settings as django_settings
USER_MODEL = getattr(django_settings, 'AUTH_USER_MODEL', 'auth.User')
# Django 1.11 Widg... | 36.21875 | 84 | 0.734254 | 350 | 0.301984 | 0 | 0 | 0 | 0 | 0 | 0 | 608 | 0.52459 |
58bd378d11da26df2129a68edbd47f10e2375dc5 | 10,649 | py | Python | ethereum.py/ethereum/clients/ethereum.py | dixonwhitmire/connect-clients | 09bf6f53f0a4fc923d1fb18f75ce86521880517c | [
"Apache-2.0"
] | null | null | null | ethereum.py/ethereum/clients/ethereum.py | dixonwhitmire/connect-clients | 09bf6f53f0a4fc923d1fb18f75ce86521880517c | [
"Apache-2.0"
] | 6 | 2021-07-13T19:58:58.000Z | 2021-11-02T21:25:14.000Z | ethereum.py/ethereum/clients/ethereum.py | dixonwhitmire/connect-clients | 09bf6f53f0a4fc923d1fb18f75ce86521880517c | [
"Apache-2.0"
] | 1 | 2021-07-13T19:22:04.000Z | 2021-07-13T19:22:04.000Z | """
ethereum.py
ethereum.py contains an EthereumClient class that provides functions for interacting
with the Coverage.sol solidity contract on an Ethereum blockchain network.
"""
import asyncio
import datetime
import json
import logging
import os
from ethereum.clients.nats import get_nats_client
from ethereum.config ... | 42.426295 | 137 | 0.582966 | 9,273 | 0.870786 | 0 | 0 | 0 | 0 | 2,580 | 0.242276 | 3,673 | 0.344915 |
58bd44d4180b36c4fc8b719cc1462f1b22fa94a6 | 1,759 | py | Python | cli/actions/mc_combination_action.py | daneshvar-amrollahi/polar | b72254e1a8354e6a10135cd3990b8edfda02559e | [
"MIT"
] | 1 | 2021-11-14T05:52:21.000Z | 2021-11-14T05:52:21.000Z | cli/actions/mc_combination_action.py | daneshvar-amrollahi/polar | b72254e1a8354e6a10135cd3990b8edfda02559e | [
"MIT"
] | null | null | null | cli/actions/mc_combination_action.py | daneshvar-amrollahi/polar | b72254e1a8354e6a10135cd3990b8edfda02559e | [
"MIT"
] | null | null | null | from argparse import Namespace
from .action import Action
from symengine.lib.symengine_wrapper import sympify
from termcolor import colored
from program.mc_comb_finder import MCCombFinder
from cli.common import prepare_program
class MCCombinationAction(Action):
cli_args: Namespace
def __init__(self, cli_args... | 37.425532 | 114 | 0.637862 | 1,529 | 0.869244 | 0 | 0 | 0 | 0 | 0 | 0 | 286 | 0.162592 |
58c073b6ae4e5dbeb4eb910c743f8e1c8773b328 | 494 | py | Python | docker/gunicorn.py | admariner/madewithwagtail | a43b3263c0f151ece4994fccd561b0575db4979f | [
"MIT"
] | null | null | null | docker/gunicorn.py | admariner/madewithwagtail | a43b3263c0f151ece4994fccd561b0575db4979f | [
"MIT"
] | null | null | null | docker/gunicorn.py | admariner/madewithwagtail | a43b3263c0f151ece4994fccd561b0575db4979f | [
"MIT"
] | null | null | null | import gunicorn
accesslog = "-"
errorlog = "-"
access_log_format = '%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s" "%({X-Forwarded-For}i)s"'
capture_output = True
forwarded_allow_ips = "*"
secure_scheme_headers = {"X-CLOUDFRONT": "yes"}
workers = 2
worker_class = "gthread"
worker_connections = 5
bind = ":... | 27.444444 | 106 | 0.690283 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 243 | 0.491903 |
58c135e6998a8525b0faabf5c07d8105ddf708e8 | 1,596 | py | Python | Lista 2/Questao_1.py | flaviomelo10/Python-para-PLN | 845da043c2618f3aace655cf065fca3d866342d5 | [
"MIT"
] | null | null | null | Lista 2/Questao_1.py | flaviomelo10/Python-para-PLN | 845da043c2618f3aace655cf065fca3d866342d5 | [
"MIT"
] | null | null | null | Lista 2/Questao_1.py | flaviomelo10/Python-para-PLN | 845da043c2618f3aace655cf065fca3d866342d5 | [
"MIT"
] | null | null | null | # -- encoding:utf-8 -- #
'''
Crie uma variรกvel com a string โ instituto de ciรชncias matemรกticas e de computaรงรฃoโ e faรงa:
a. Concatene (adicione) uma outra string chamada โuspโ
b. Concatene (adicione) uma outra informaรงรฃo: 2021
c. Verifique o tamanho da nova string (com as informaรงรตes adicionadas das questรตes a e b), co... | 24.181818 | 155 | 0.734962 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,221 | 0.738657 |
58c1cf2e7948459916f7782bc8f6b76e361226be | 753 | py | Python | breadcrumbs/templatetags/breadcrumbs_tags.py | LinuxOSsk/Shakal-NG | c4091c7972cffd86f64aa9f9a058d2907a56e5eb | [
"MIT"
] | 10 | 2016-02-06T15:40:30.000Z | 2018-09-27T15:15:13.000Z | breadcrumbs/templatetags/breadcrumbs_tags.py | LinuxOSsk/Shakal-NG | c4091c7972cffd86f64aa9f9a058d2907a56e5eb | [
"MIT"
] | 94 | 2016-02-04T18:39:36.000Z | 2022-01-20T05:25:00.000Z | breadcrumbs/templatetags/breadcrumbs_tags.py | LinuxOSsk/Shakal-NG | c4091c7972cffd86f64aa9f9a058d2907a56e5eb | [
"MIT"
] | 8 | 2016-05-10T20:29:53.000Z | 2021-02-07T00:50:31.000Z | # -*- coding: utf-8 -*-
from django.shortcuts import resolve_url
from django.template.loader import render_to_string
from django_jinja import library
from jinja2 import contextfunction
@contextfunction
@library.global_function
def breadcrumb(context, contents, *args, **kwargs):
class_name = kwargs.pop('class', False... | 25.1 | 61 | 0.755644 | 0 | 0 | 0 | 0 | 562 | 0.746348 | 0 | 0 | 115 | 0.152722 |
58c23fc6ab7f8d080ab7dfae6e27ec6257ea2869 | 1,334 | py | Python | contrib/opencensus-ext-datadog/opencensus/ext/datadog/transport.py | Flared/opencensus-python | e2535e688a50c7a06be8af93ca3b987d387da605 | [
"Apache-2.0"
] | 650 | 2017-07-09T02:08:10.000Z | 2022-03-22T20:39:54.000Z | contrib/opencensus-ext-datadog/opencensus/ext/datadog/transport.py | Flared/opencensus-python | e2535e688a50c7a06be8af93ca3b987d387da605 | [
"Apache-2.0"
] | 735 | 2017-07-26T01:15:16.000Z | 2022-03-29T20:17:20.000Z | contrib/opencensus-ext-datadog/opencensus/ext/datadog/transport.py | Flared/opencensus-python | e2535e688a50c7a06be8af93ca3b987d387da605 | [
"Apache-2.0"
] | 256 | 2017-07-24T18:29:15.000Z | 2022-03-15T15:33:03.000Z | import platform
import requests
class DDTransport(object):
""" DDTransport contains all the logic for sending Traces to Datadog
:type trace_addr: str
:param trace_addr: trace_addr specifies the host[:port] address of the
Datadog Trace Agent.
"""
def __init__(self, trace_addr):
self._... | 28.382979 | 83 | 0.595202 | 1,298 | 0.973013 | 0 | 0 | 310 | 0.232384 | 0 | 0 | 721 | 0.54048 |
58c4071d4471ff72fd95738a79b453160bfc2e4b | 252 | py | Python | credsweeper/file_handler/analysis_target.py | ARKAD97/CredSweeper | 0f613cded13d6c28c19c57eac54dd245b2c318ea | [
"MIT"
] | null | null | null | credsweeper/file_handler/analysis_target.py | ARKAD97/CredSweeper | 0f613cded13d6c28c19c57eac54dd245b2c318ea | [
"MIT"
] | null | null | null | credsweeper/file_handler/analysis_target.py | ARKAD97/CredSweeper | 0f613cded13d6c28c19c57eac54dd245b2c318ea | [
"MIT"
] | null | null | null | from typing import List
class AnalysisTarget:
def __init__(self, line: str, line_num: int, lines: List[str], file_path: str):
self.line = line
self.line_num = line_num
self.lines = lines
self.file_path = file_path
| 25.2 | 83 | 0.650794 | 225 | 0.892857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
58c4179e5713c05abfe6169f74df8cd9ca6987a4 | 5,558 | py | Python | model/vgg_deeplab.py | ireina7/zero-shot-segmentation | 870d08ad7ea3965f006d0eb44667f6ecd87ef205 | [
"MIT"
] | null | null | null | model/vgg_deeplab.py | ireina7/zero-shot-segmentation | 870d08ad7ea3965f006d0eb44667f6ecd87ef205 | [
"MIT"
] | null | null | null | model/vgg_deeplab.py | ireina7/zero-shot-segmentation | 870d08ad7ea3965f006d0eb44667f6ecd87ef205 | [
"MIT"
] | null | null | null | import torchvision
import torch
import torch.nn as nn
import torch.nn.functional as F
class Vgg_Deeplab(nn.Module):
def __init__(self,*args, **kwargs):
super(Vgg_Deeplab, self).__init__()
vgg16 = torchvision.models.vgg16()
layers = []
layers.append(nn.Conv2d(3, 64, kernel_size=3, ... | 35.858065 | 84 | 0.526268 | 5,052 | 0.90896 | 1,119 | 0.201331 | 0 | 0 | 0 | 0 | 608 | 0.109392 |
58c5f8a4b5b023272ffe37f64fa23b186bdc1cd0 | 510 | py | Python | web/app.py | erberlin/themepark-times-API | 0b6a44224c3d5e1f98399ac30e96e35bad38849e | [
"MIT"
] | 7 | 2019-04-19T16:32:24.000Z | 2019-07-10T12:41:50.000Z | web/app.py | erberlin/themepark-times-API | 0b6a44224c3d5e1f98399ac30e96e35bad38849e | [
"MIT"
] | null | null | null | web/app.py | erberlin/themepark-times-API | 0b6a44224c3d5e1f98399ac30e96e35bad38849e | [
"MIT"
] | 1 | 2019-07-10T04:36:43.000Z | 2019-07-10T04:36:43.000Z | # -*- coding: utf-8 -*-
"""
This module defines a connexion app object and configures the API
endpoints based the swagger.yml configuration file.
copyright: ยฉ 2019 by Erik R Berlin.
license: MIT, see LICENSE for more details.
"""
import connexion
app = connexion.App(__name__, specification_dir="./")
app.app.url_map... | 25.5 | 86 | 0.731373 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 340 | 0.665362 |
58c6d6c03c23a334c302f4903855ceb65421ce9b | 2,341 | py | Python | CLIMATExScience/air-pollution-index/data-visualization/pollutant-freq.py | MY-Climate-Observatory/myco-data | 5203fa63c7ce609bbc9bbc4186f55da78befdc50 | [
"CC-BY-4.0"
] | null | null | null | CLIMATExScience/air-pollution-index/data-visualization/pollutant-freq.py | MY-Climate-Observatory/myco-data | 5203fa63c7ce609bbc9bbc4186f55da78befdc50 | [
"CC-BY-4.0"
] | null | null | null | CLIMATExScience/air-pollution-index/data-visualization/pollutant-freq.py | MY-Climate-Observatory/myco-data | 5203fa63c7ce609bbc9bbc4186f55da78befdc50 | [
"CC-BY-4.0"
] | 1 | 2021-12-16T04:56:09.000Z | 2021-12-16T04:56:09.000Z | # -*- coding: utf-8 -*-
"""
17 June 2020
Author: Xiandi Ooi
Visualizing the types of pollutants.
"""
import pandas as pd
from plotly.offline import plot
import plotly.graph_objects as go
# Get the file from us
df = pd.read_csv(https://www.dropbox.com/s/u0ymg0ufne0an60/api-20200713.csv?dl=1", sep = ";")
# Make the ... | 32.971831 | 101 | 0.612986 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 614 | 0.262281 |
58c6e236acba1419c8019e6e9d0019c26bbbfc7f | 3,977 | py | Python | tests/bs3/test_block_fields.py | rpkilby/django-template-forms | 5099d87d661a6a313df49fa484afd94f145e65bc | [
"BSD-3-Clause"
] | 1 | 2021-01-29T11:53:32.000Z | 2021-01-29T11:53:32.000Z | tests/bs3/test_block_fields.py | rpkilby/django-template-forms | 5099d87d661a6a313df49fa484afd94f145e65bc | [
"BSD-3-Clause"
] | 5 | 2017-11-29T11:01:56.000Z | 2018-02-05T23:34:08.000Z | tests/bs3/test_block_fields.py | rpkilby/django-template-forms | 5099d87d661a6a313df49fa484afd94f145e65bc | [
"BSD-3-Clause"
] | null | null | null |
from django import forms
from django.test import TestCase
from template_forms import bs3
def startswith_a(value):
if value.startswith('a'):
return value
raise forms.ValidationError('Value must start with "a".')
def not_now(value):
if value:
raise forms.ValidationError('I cannot let you... | 30.829457 | 103 | 0.538094 | 3,629 | 0.912497 | 0 | 0 | 0 | 0 | 0 | 0 | 1,852 | 0.465678 |
58c773feba3d980c07a404541fff29ea0e07df10 | 19,463 | py | Python | bzt/modules/java.py | 3dgiordano/taurus | 77cb31b6f0e5c27545094f600ac2b595fa76d992 | [
"Apache-2.0"
] | 1 | 2018-02-17T16:00:34.000Z | 2018-02-17T16:00:34.000Z | bzt/modules/java.py | 3dgiordano/taurus | 77cb31b6f0e5c27545094f600ac2b595fa76d992 | [
"Apache-2.0"
] | 5 | 2018-03-10T20:50:24.000Z | 2021-08-20T15:07:32.000Z | bzt/modules/java.py | 3dgiordano/taurus | 77cb31b6f0e5c27545094f600ac2b595fa76d992 | [
"Apache-2.0"
] | 1 | 2018-05-04T23:06:15.000Z | 2018-05-04T23:06:15.000Z | """
Copyright 2017 BlazeMeter 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, software... | 41.946121 | 121 | 0.640138 | 17,451 | 0.896624 | 0 | 0 | 0 | 0 | 0 | 0 | 4,120 | 0.211684 |
58c8432548a967e56cf908c27cbcc2cdbca067b8 | 1,434 | py | Python | various_modules/interface_segregation_principle.py | Neykah/design_patterns_python | 6f801fc4fc60f2d34002e4fe435feb6111a2cd23 | [
"MIT"
] | null | null | null | various_modules/interface_segregation_principle.py | Neykah/design_patterns_python | 6f801fc4fc60f2d34002e4fe435feb6111a2cd23 | [
"MIT"
] | null | null | null | various_modules/interface_segregation_principle.py | Neykah/design_patterns_python | 6f801fc4fc60f2d34002e4fe435feb6111a2cd23 | [
"MIT"
] | null | null | null | """
Maybe not so relevant in Python due to the possibility to use multiple inheritance...
"""
from abc import ABC, abstractmethod
class CloudHostingProvider(ABC):
@abstractmethod
def create_server(region):
...
@abstractmethod
def list_servers(region):
...
class CDNProvider(ABC):
... | 22.40625 | 85 | 0.642259 | 1,154 | 0.804742 | 0 | 0 | 274 | 0.191074 | 0 | 0 | 399 | 0.278243 |
58c8441bd96dbfec3988f61c1477017eb7ba3344 | 3,536 | py | Python | SCSCons/Variables/PackageVariable.py | Relintai/pandemonium_engine | 3de05db75a396b497f145411f71eb363572b38ae | [
"MIT",
"Apache-2.0",
"CC-BY-4.0",
"Unlicense"
] | 1,403 | 2017-11-23T14:24:01.000Z | 2022-03-30T20:59:39.000Z | nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/PackageVariable.py | lps1333/Nuitka | 02e8d59a275cd7fe482cbc8100e753ff5abe39d7 | [
"Apache-2.0"
] | 3,708 | 2017-11-27T13:47:12.000Z | 2022-03-29T17:21:17.000Z | nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/PackageVariable.py | lps1333/Nuitka | 02e8d59a275cd7fe482cbc8100e753ff5abe39d7 | [
"Apache-2.0"
] | 281 | 2017-12-01T23:48:38.000Z | 2022-03-31T15:25:44.000Z | # MIT License
#
# Copyright The SCons Foundation
#
# 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, ... | 32.740741 | 101 | 0.669683 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,643 | 0.747455 |
58c98a83a2ec15c194e9ea24edc51018cb47644a | 8,351 | py | Python | tests/test_protocol.py | kwikiel/edgedb | dac3f0c408bcf3fe9159b7f844d0186c54aaa3fd | [
"Apache-2.0"
] | null | null | null | tests/test_protocol.py | kwikiel/edgedb | dac3f0c408bcf3fe9159b7f844d0186c54aaa3fd | [
"Apache-2.0"
] | null | null | null | tests/test_protocol.py | kwikiel/edgedb | dac3f0c408bcf3fe9159b7f844d0186c54aaa3fd | [
"Apache-2.0"
] | null | null | null | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2020-present MagicStack Inc. and the EdgeDB authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http... | 33.138889 | 79 | 0.554305 | 7,524 | 0.90097 | 0 | 0 | 0 | 0 | 7,457 | 0.892947 | 2,557 | 0.306191 |
58cc1d434d0ca910c890148d1eb3817d02e4f5af | 278 | py | Python | 210125/homework_re_3.py | shadowsmain/pyton-adv | 9562097b2d34c1b286c13cf0930fa06079532a67 | [
"MIT"
] | null | null | null | 210125/homework_re_3.py | shadowsmain/pyton-adv | 9562097b2d34c1b286c13cf0930fa06079532a67 | [
"MIT"
] | null | null | null | 210125/homework_re_3.py | shadowsmain/pyton-adv | 9562097b2d34c1b286c13cf0930fa06079532a67 | [
"MIT"
] | null | null | null | import re
RE_NUMBER_VALIDATOR = re.compile(r'^\d+[.,]\d+$')
def number_is_valid(number):
return RE_NUMBER_VALIDATOR.match(number)
assert number_is_valid('1.32')
assert number_is_valid('1,32')
assert not number_is_valid('asdasd1234')
assert not number_is_valid('22,a44') | 21.384615 | 49 | 0.755396 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 47 | 0.169065 |
58cc767b16ca728bd586a1ff7e220380c8ce5e1a | 3,529 | py | Python | shp_code/prec_reformat.py | anahm/inferring-population-preferences | 1eec9c6966e65c615f3cf5bd769ab121369b926d | [
"Unlicense"
] | 4 | 2016-10-29T12:10:48.000Z | 2016-11-06T02:25:09.000Z | shp_code/prec_reformat.py | anahm/inferring-population-preferences | 1eec9c6966e65c615f3cf5bd769ab121369b926d | [
"Unlicense"
] | null | null | null | shp_code/prec_reformat.py | anahm/inferring-population-preferences | 1eec9c6966e65c615f3cf5bd769ab121369b926d | [
"Unlicense"
] | null | null | null | """
prec_reformat.py
Taking state data and having each line be a precinct's voting results and candidate
cf-scores (rather than each line be each candidate per precinct.
| prec_id | cf_score_0 | num_votes_0 | cf_score_1 | num_votes_1 |
"""
import math
import numpy as np
import pandas as pd
from prec_cd import prec_... | 26.140741 | 83 | 0.616322 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,244 | 0.352508 |
58ce3480a9b43387f9f12525806c69631b6a2afa | 1,668 | py | Python | scripts/make_fasta.py | orionzhou/snk-rnaseq | 5ead8aebf5ed00a2aec15363b8023c9b75b0ed4a | [
"MIT"
] | null | null | null | scripts/make_fasta.py | orionzhou/snk-rnaseq | 5ead8aebf5ed00a2aec15363b8023c9b75b0ed4a | [
"MIT"
] | null | null | null | scripts/make_fasta.py | orionzhou/snk-rnaseq | 5ead8aebf5ed00a2aec15363b8023c9b75b0ed4a | [
"MIT"
] | null | null | null | from snakemake import shell
input, output, params, threads, w, config = snakemake.input, snakemake.output, snakemake.params, snakemake.threads, snakemake.wildcards, snakemake.config
genome = w.genome
params.hybrid = config['x'][genome]['hybrid']
opt = params.opt
shell("""
rm -rf {output.fna}* {output.fai}*
rm... | 32.076923 | 153 | 0.631894 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,233 | 0.739209 |
58ceaafc2d2819124d87eef37b783e73dcf0c336 | 2,358 | py | Python | HanderCode/aidaiwangApp/aidaiwangApp/Login_aidaiwangApp.py | mocne/PycharmProjects | b009e530f4f01e5b1826bbe2364d86b65bcd66e3 | [
"MIT"
] | null | null | null | HanderCode/aidaiwangApp/aidaiwangApp/Login_aidaiwangApp.py | mocne/PycharmProjects | b009e530f4f01e5b1826bbe2364d86b65bcd66e3 | [
"MIT"
] | null | null | null | HanderCode/aidaiwangApp/aidaiwangApp/Login_aidaiwangApp.py | mocne/PycharmProjects | b009e530f4f01e5b1826bbe2364d86b65bcd66e3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import time
import xlrd
import Register_aidaiwangApp
import LogOut_aidiawangApp
def start_to_login(filename):
print(u'login')
driver = Register_aidaiwangApp.driver
driver.launch_app()
time.sleep(3)
try:
driver.find_element_by_id('cn.phaidai.loan:id/rb_mine')
... | 33.685714 | 98 | 0.636556 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 584 | 0.245585 |
58cf4798257428d881df3e8a39b178b627d7c8dd | 389 | py | Python | Python/Learning/Language/arg_ex.py | prynix/learning-programming | 85aea40a61fb824a2b4e142331d9ac7971fef263 | [
"MIT"
] | 2 | 2017-03-14T16:02:08.000Z | 2017-05-02T13:48:18.000Z | Python/Learning/Language/arg_ex.py | CajetanP/learning-programming | 85aea40a61fb824a2b4e142331d9ac7971fef263 | [
"MIT"
] | 4 | 2021-05-20T21:10:13.000Z | 2022-02-26T09:50:19.000Z | Python/Learning/Language/arg_ex.py | CajetanP/learning-programming | 85aea40a61fb824a2b4e142331d9ac7971fef263 | [
"MIT"
] | 1 | 2021-06-18T01:31:24.000Z | 2021-06-18T01:31:24.000Z | from sys import argv
script, user_name = argv
prompt = '>'
print(user_name, script)
print("Do you like me " + user_name + "?")
likes = input(prompt)
print("Where do you live " + user_name + "?")
lives = input(prompt)
print("""
So you said {:s} about liking me.
You live in {:s}.
""".format(likes, lives))
print("Scr... | 16.208333 | 45 | 0.62982 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 131 | 0.336761 |
58cf698a07fcbc7df1f0d9ad44c0aa4f953a79ab | 2,565 | py | Python | tests/functional/test_uploads.py | jounile/nollanet | 7bea20934d3f5e09658a9d31c3b05c15416398a0 | [
"MIT"
] | 3 | 2019-10-13T08:37:13.000Z | 2020-02-16T12:24:11.000Z | tests/functional/test_uploads.py | jounile/nollanet | 7bea20934d3f5e09658a9d31c3b05c15416398a0 | [
"MIT"
] | 5 | 2019-11-13T15:56:52.000Z | 2021-04-30T20:58:19.000Z | tests/functional/test_uploads.py | jounile/nollanet | 7bea20934d3f5e09658a9d31c3b05c15416398a0 | [
"MIT"
] | 1 | 2020-04-08T21:09:52.000Z | 2020-04-08T21:09:52.000Z | import io
import pytest
from requests import get
from urllib.parse import urljoin
def test_my_uploads_page(wait_for_api, login_user):
"""
GIVEN a user has logged in (login_user)
WHEN the '/my/uploads' page is navigated to (GET)
THEN check the response is valid and page title is correct
"""
requ... | 40.078125 | 109 | 0.71384 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,477 | 0.575828 |
58cfe77be2b1a529ec5b49496f3549cf64c84e22 | 1,107 | py | Python | plugins/python/test/testCustomEntity.py | shotgunsoftware/cplusplus-api | 576aab4ae266e37ba80da23f82fe9ed08b9894e4 | [
"BSD-3-Clause"
] | 3 | 2015-04-04T03:08:52.000Z | 2021-01-09T00:09:25.000Z | plugins/python/test/testCustomEntity.py | shotgunsoftware/cplusplus-api | 576aab4ae266e37ba80da23f82fe9ed08b9894e4 | [
"BSD-3-Clause"
] | null | null | null | plugins/python/test/testCustomEntity.py | shotgunsoftware/cplusplus-api | 576aab4ae266e37ba80da23f82fe9ed08b9894e4 | [
"BSD-3-Clause"
] | 4 | 2015-04-04T03:08:57.000Z | 2021-10-03T14:59:23.000Z | #!/usr/bin/env python
import sys
from shotgun import *
try:
if len(sys.argv) > 1:
sg = Shotgun(sys.argv[1])
else:
sg = Shotgun()
#################################################################
# Find CustomEntity01 entities
#######################################################... | 31.628571 | 79 | 0.443541 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 551 | 0.497742 |
58d09df8656249313c3aee99521da7185757d936 | 24,955 | py | Python | word2vec_np/utils/data.py | mkserge/word2vec-np | 6b53b7e3defd7c8333dcb9d9098e16502a9ce20f | [
"MIT"
] | 1 | 2021-11-22T11:30:10.000Z | 2021-11-22T11:30:10.000Z | word2vec_np/utils/data.py | mkserge/word2vec-np | 6b53b7e3defd7c8333dcb9d9098e16502a9ce20f | [
"MIT"
] | null | null | null | word2vec_np/utils/data.py | mkserge/word2vec-np | 6b53b7e3defd7c8333dcb9d9098e16502a9ce20f | [
"MIT"
] | null | null | null | import word2vec_np.utils.checks as checks
import collections
import numpy as np
import math
import time
import logging
def get_sentences_from_file(train_file):
""" Returns a list of sentences from an input file.
Args:
train_file: A path to a file
Returns:
A list of sentence... | 40.909836 | 123 | 0.640232 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11,317 | 0.453496 |
58d14d425be795bfa4409700edc4323d29494ae2 | 307 | py | Python | nicegui/elements/row.py | florianwittkamp/nicegui | 4c054f4e5b82e4ac56db93b73d5fb5ffcd480d06 | [
"MIT"
] | 30 | 2021-06-16T15:46:45.000Z | 2022-03-27T03:14:18.000Z | nicegui/elements/row.py | florianwittkamp/nicegui | 4c054f4e5b82e4ac56db93b73d5fb5ffcd480d06 | [
"MIT"
] | 11 | 2021-05-24T17:05:22.000Z | 2022-02-19T07:13:18.000Z | nicegui/elements/row.py | florianwittkamp/nicegui | 4c054f4e5b82e4ac56db93b73d5fb5ffcd480d06 | [
"MIT"
] | 7 | 2021-07-22T05:51:04.000Z | 2022-01-31T19:39:37.000Z | import justpy as jp
from .group import Group
class Row(Group):
def __init__(self):
'''Row Element
Provides a container which arranges its child in a row.
'''
view = jp.QDiv(classes='row items-start', style='gap: 1em', delete_flag=False)
super().__init__(view)
| 23.615385 | 86 | 0.628664 | 260 | 0.846906 | 0 | 0 | 0 | 0 | 0 | 0 | 118 | 0.384365 |
58d1b1562239fddc199cba78a4c7fd5ac432e0af | 102 | py | Python | src/mtvs/__init__.py | digsim/mtvs | d89d12d4cd65eafe732226e588a54874123db7f4 | [
"Apache-2.0"
] | 2 | 2017-11-19T05:51:31.000Z | 2020-01-22T08:12:53.000Z | src/mtvs/__init__.py | digsim/mtvs | d89d12d4cd65eafe732226e588a54874123db7f4 | [
"Apache-2.0"
] | 3 | 2015-12-03T00:34:46.000Z | 2016-01-04T15:49:14.000Z | src/mtvs/__init__.py | digsim/missingTvShows | f17660dc965c7a6eef1b0cfad9577d62087cba56 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import pkg_resources
__version__ = pkg_resources.require("mtvs")[0].version
| 17 | 54 | 0.705882 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 29 | 0.284314 |
58d37fec96977e11aa6010c2276ce5434c4fc6f8 | 452 | py | Python | tests/guinea-pigs/unittest/expected_failure.py | Tirzono/teamcity-messages | e7f7334e2956a9e707222e4c83de9ffeb15b8ac0 | [
"Apache-2.0"
] | 105 | 2015-06-24T15:40:41.000Z | 2022-02-04T10:30:34.000Z | tests/guinea-pigs/unittest/expected_failure.py | Tirzono/teamcity-messages | e7f7334e2956a9e707222e4c83de9ffeb15b8ac0 | [
"Apache-2.0"
] | 145 | 2015-06-24T15:26:28.000Z | 2022-03-22T20:04:19.000Z | tests/guinea-pigs/unittest/expected_failure.py | Tirzono/teamcity-messages | e7f7334e2956a9e707222e4c83de9ffeb15b8ac0 | [
"Apache-2.0"
] | 76 | 2015-07-20T08:18:21.000Z | 2022-03-18T20:03:53.000Z | # coding=utf-8
import sys
from teamcity.unittestpy import TeamcityTestRunner
if sys.version_info < (2, 7):
from unittest2 import main, TestCase, expectedFailure
else:
from unittest import main, TestCase, expectedFailure
class TestSkip(TestCase):
def test_expected_failure(self):
self.fail("this sh... | 26.588235 | 66 | 0.783186 | 183 | 0.404867 | 0 | 0 | 0 | 0 | 0 | 0 | 48 | 0.106195 |
58d426717d52de8aec95bf782518c3dd7fa7dafe | 877 | py | Python | main.py | GabrielIFPB/wishlist-fastapi | 1d39bf4c65dcc4491d0836487a218e67dbb07a80 | [
"MIT"
] | null | null | null | main.py | GabrielIFPB/wishlist-fastapi | 1d39bf4c65dcc4491d0836487a218e67dbb07a80 | [
"MIT"
] | null | null | null | main.py | GabrielIFPB/wishlist-fastapi | 1d39bf4c65dcc4491d0836487a218e67dbb07a80 | [
"MIT"
] | null | null | null |
import uvicorn
from fastapi import FastAPI
from database import Base, engine
from routers.user import router as router_user
from routers.product import router as router_product
from routers.authentication import router as router_auth
app = FastAPI(
title="Wish List",
description="Permita que seus clientes acompan... | 21.925 | 116 | 0.735462 | 0 | 0 | 0 | 0 | 233 | 0.265678 | 0 | 0 | 332 | 0.378563 |
58d441702771292f5be7e698cfa7a42a16e08886 | 1,605 | py | Python | libs/data_layers/transform.py | lsc25846/Wildlife-Recognition-System | 81d8afdf4a50bc94bf5e1952bfce1b5a9c4c6bd2 | [
"MIT"
] | null | null | null | libs/data_layers/transform.py | lsc25846/Wildlife-Recognition-System | 81d8afdf4a50bc94bf5e1952bfce1b5a9c4c6bd2 | [
"MIT"
] | null | null | null | libs/data_layers/transform.py | lsc25846/Wildlife-Recognition-System | 81d8afdf4a50bc94bf5e1952bfce1b5a9c4c6bd2 | [
"MIT"
] | null | null | null | # encoding: utf-8
import torch
import cv2
import numpy as np
import pdb
def detection_collate(batch):
"""Custom collate fn for dealing with batches of images that have a different
number of associated object annotations (bounding boxes).
Arguments:
batch: (tuple) A tuple of tensor images and lists... | 29.181818 | 81 | 0.633022 | 313 | 0.195016 | 0 | 0 | 0 | 0 | 0 | 0 | 575 | 0.358255 |
58d6ba044f8814b989985c1b13e416f82125fe24 | 2,273 | py | Python | rllab/torch/algos/base.py | NeurIPSPaperSubmission7934/code_submission | 713fce673e8e3ba30b559d4eebe6d3e4891069ed | [
"Apache-2.0"
] | null | null | null | rllab/torch/algos/base.py | NeurIPSPaperSubmission7934/code_submission | 713fce673e8e3ba30b559d4eebe6d3e4891069ed | [
"Apache-2.0"
] | null | null | null | rllab/torch/algos/base.py | NeurIPSPaperSubmission7934/code_submission | 713fce673e8e3ba30b559d4eebe6d3e4891069ed | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018 Copyright holder of the paper Generative Adversarial Model Learning
# submitted to NeurIPS 2019 for review
# All rights reserved.
import numpy as np
import torch
class Optimizer(object):
def __init__(self, policy, use_gpu=False):
self.networks = self._init_networks(policy.input_dim, ... | 33.925373 | 88 | 0.661681 | 1,287 | 0.566212 | 0 | 0 | 220 | 0.096788 | 0 | 0 | 203 | 0.089309 |
58d6f86c63a774052533d60d46858c6d938085a4 | 915 | py | Python | lab-4.py | PavelKovalets/python-reviewer-test | a4d489482f596570abd5d34677f7549e1b724c8e | [
"MIT"
] | null | null | null | lab-4.py | PavelKovalets/python-reviewer-test | a4d489482f596570abd5d34677f7549e1b724c8e | [
"MIT"
] | null | null | null | lab-4.py | PavelKovalets/python-reviewer-test | a4d489482f596570abd5d34677f7549e1b724c8e | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import boto3
source_ddb = boto3.resource('dynamodb', 'us-east-1')
dest_ddb = boto3.client('dynamodb', 'us-west-2')
def sync(source_ddb, dest_ddb):
table = source_ddb.Table("CodeGuru-MusicCollection")
scan_kwargs = {
'ProjectionExpression': "Artist, SongTitle"
}
done = False
... | 33.888889 | 81 | 0.619672 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 260 | 0.284153 |
58d7f0d0c28563ede738e4f0ad2b23de85fe0aac | 2,492 | py | Python | core/reports/views.py | jilbertozamorasaa/panda-bigmon-core | 4e38411489e9ca538a000df43aed5280a72b4342 | [
"Apache-2.0"
] | 3 | 2017-07-19T18:29:23.000Z | 2021-11-18T04:57:18.000Z | core/reports/views.py | jilbertozamorasaa/panda-bigmon-core | 4e38411489e9ca538a000df43aed5280a72b4342 | [
"Apache-2.0"
] | 3 | 2021-09-01T15:20:21.000Z | 2022-03-12T01:02:51.000Z | core/reports/views.py | jilbertozamorasaa/panda-bigmon-core | 4e38411489e9ca538a000df43aed5280a72b4342 | [
"Apache-2.0"
] | 9 | 2015-11-17T15:52:23.000Z | 2021-09-07T12:23:16.000Z | """
"""
import json
from django.views.decorators.cache import never_cache
from django.http import HttpResponse
from django.shortcuts import render_to_response
from core.views import initRequest, DateEncoder
from core.reports import MC16aCPReport, ObsoletedTasksReport, TitanProgressReport
@never_cache
def report(r... | 43.719298 | 270 | 0.72191 | 0 | 0 | 0 | 0 | 2,197 | 0.881621 | 0 | 0 | 527 | 0.211477 |
58d8fe58ae3d14e3614960efa20628276cc29e39 | 4,594 | py | Python | xain/fl/participant/participant.py | danieljanes/ox-msc-diss-code-freeze | 20c6881cabdf1e3ed7a9ddb40bbdcc7a7fd22f78 | [
"Apache-2.0"
] | 1 | 2020-05-30T20:34:19.000Z | 2020-05-30T20:34:19.000Z | xain/fl/participant/participant.py | danieljanes/ox-msc-diss-code-freeze | 20c6881cabdf1e3ed7a9ddb40bbdcc7a7fd22f78 | [
"Apache-2.0"
] | null | null | null | xain/fl/participant/participant.py | danieljanes/ox-msc-diss-code-freeze | 20c6881cabdf1e3ed7a9ddb40bbdcc7a7fd22f78 | [
"Apache-2.0"
] | null | null | null | from typing import Dict, List, Tuple
import numpy as np
import tensorflow as tf
from absl import logging
from xain.datasets import prep
from xain.types import History, Metrics, Partition, Theta, VolumeByClass
from .model_provider import ModelProvider
class Participant:
# pylint: disable-msg=too-many-arguments
... | 35.068702 | 88 | 0.653243 | 3,532 | 0.768829 | 0 | 0 | 0 | 0 | 0 | 0 | 549 | 0.119504 |
58db0a434e3091024b2614aa6f89111b6536e4cd | 1,380 | py | Python | client/animation/qr_code.py | Nurgak/IoT-RGB-LED-Matrix-Socket | e03ce4c2e2d77a6939662aad4ac92fbf9bdea77c | [
"MIT"
] | 1 | 2022-01-26T09:01:44.000Z | 2022-01-26T09:01:44.000Z | client/animation/qr_code.py | Nurgak/IoT-RGB-LED-Matrix-Socket | e03ce4c2e2d77a6939662aad4ac92fbf9bdea77c | [
"MIT"
] | 3 | 2021-12-28T10:29:02.000Z | 2022-01-06T03:01:08.000Z | client/animation/qr_code.py | Nurgak/IoT-RGB-LED-Matrix-Socket | e03ce4c2e2d77a6939662aad4ac92fbf9bdea77c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""! QR code generator animation script."""
import numpy as np
import qrcode
from src.animate import Animate
class QRCode(Animate):
"""! QR code generator animation class.
@image html qr_code.QRCode.png width=256px
Animation displaying a static QR-code-encoded-text.
"""
__C... | 30 | 87 | 0.602899 | 1,245 | 0.902174 | 835 | 0.605072 | 0 | 0 | 0 | 0 | 372 | 0.269565 |
58db8c9e99f143cbab9455bc35570eeeb524d210 | 483 | py | Python | tests/test_xiaochengtu.py | lamzuzuzu/yxf_yixue_py | 90eb077f195b543f93a507f28b0a4c016cb0c92f | [
"MIT"
] | 20 | 2019-01-08T08:13:39.000Z | 2021-12-23T09:04:14.000Z | tests/test_xiaochengtu.py | lamzuzuzu/yxf_yixue_py | 90eb077f195b543f93a507f28b0a4c016cb0c92f | [
"MIT"
] | null | null | null | tests/test_xiaochengtu.py | lamzuzuzu/yxf_yixue_py | 90eb077f195b543f93a507f28b0a4c016cb0c92f | [
"MIT"
] | 13 | 2019-04-22T03:25:13.000Z | 2022-01-04T05:43:48.000Z | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import os
import sys
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # ๅบๅฐๅๆฏๆฌ้กน็ฎๆ น็ฎๅฝ
sys.path.append(BASE_DIR)
import datetime
from yxf_yixue.xiaochengtu import XiaochengtuApi
if __name__ == '__main__':
string = '1996/02/29 23:16'
obj = datetime.... | 24.15 | 84 | 0.681159 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 101 | 0.200795 |
58dc98f64796c7f6f0664ca055829713dcb9192e | 3,662 | py | Python | _Dist/NeuralNetworks/b_TraditionalML/MultinomialNB.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 1,107 | 2016-09-21T02:18:36.000Z | 2022-03-29T02:52:12.000Z | _Dist/NeuralNetworks/b_TraditionalML/MultinomialNB.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 18 | 2016-12-22T10:24:47.000Z | 2022-03-11T23:18:43.000Z | _Dist/NeuralNetworks/b_TraditionalML/MultinomialNB.py | leoatchina/MachineLearning | 071f2c0fc6f5af3d9550cfbeafe8d537c35a76d3 | [
"MIT"
] | 776 | 2016-12-21T12:08:08.000Z | 2022-03-21T06:12:08.000Z | import numpy as np
from sklearn.preprocessing import OneHotEncoder
class MultinomialNB:
""" Naive Bayes algorithm with discrete inputs
Parameters
----------
alpha : float, optional (default=1.)
Smooth parameter used in Naive Bayes, default is 1 (which indicates a laplace smoothing)
Attri... | 29.296 | 96 | 0.560896 | 3,592 | 0.980885 | 0 | 0 | 0 | 0 | 0 | 0 | 2,368 | 0.646641 |
58df035c2ab9c1b7f4e6cbacccfa792d055318cf | 9,362 | py | Python | Reinforcement-Learning/Python-Model/venv/lib/python3.8/site-packages/tensorflow/core/protobuf/graph_debug_info_pb2.py | lawrence910426/ProgrammingII_FinalProject | 493183dc2a674310e65bffe3a5e00395e8bebb4b | [
"MIT"
] | null | null | null | Reinforcement-Learning/Python-Model/venv/lib/python3.8/site-packages/tensorflow/core/protobuf/graph_debug_info_pb2.py | lawrence910426/ProgrammingII_FinalProject | 493183dc2a674310e65bffe3a5e00395e8bebb4b | [
"MIT"
] | null | null | null | Reinforcement-Learning/Python-Model/venv/lib/python3.8/site-packages/tensorflow/core/protobuf/graph_debug_info_pb2.py | lawrence910426/ProgrammingII_FinalProject | 493183dc2a674310e65bffe3a5e00395e8bebb4b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tensorflow/core/protobuf/graph_debug_info.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as... | 39.838298 | 888 | 0.760735 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,811 | 0.300256 |
58df52412971e5d196be467f42346c84563d779e | 1,376 | py | Python | tests/inferfaces_tests/test_people.py | jmolinski/traktpy | e6ff22acaf273b7b45070a4f8938c210fe4d63d7 | [
"MIT"
] | null | null | null | tests/inferfaces_tests/test_people.py | jmolinski/traktpy | e6ff22acaf273b7b45070a4f8938c210fe4d63d7 | [
"MIT"
] | 1 | 2019-04-13T10:15:48.000Z | 2019-04-13T10:15:48.000Z | tests/inferfaces_tests/test_people.py | jmolinski/traktpy | e6ff22acaf273b7b45070a4f8938c210fe4d63d7 | [
"MIT"
] | null | null | null | import pytest
from tests.test_data.lists import LIST
from tests.test_data.people import MOVIE_CREDITS, PERSON, SHOW_CREDITS
from tests.utils import mk_mock_client
from trakt.core.exceptions import ArgumentError
from trakt.core.json_parser import parse_tree
from trakt.core.models import Person
def test_get_person():
... | 32 | 83 | 0.721657 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 110 | 0.079942 |
58e00459697805d8f1e7adbc2795e9616fc70667 | 3,717 | py | Python | batch_score.py | Lufedi/reaper | bdf56b499e5b704c27b9f6c053d798c2a10fa4cf | [
"Apache-2.0"
] | 106 | 2015-07-21T16:18:26.000Z | 2022-03-31T06:45:34.000Z | batch_score.py | Lufedi/reaper | bdf56b499e5b704c27b9f6c053d798c2a10fa4cf | [
"Apache-2.0"
] | 21 | 2015-07-11T03:48:28.000Z | 2022-01-18T12:57:30.000Z | batch_score.py | Lufedi/reaper | bdf56b499e5b704c27b9f6c053d798c2a10fa4cf | [
"Apache-2.0"
] | 26 | 2015-07-22T22:38:21.000Z | 2022-03-14T10:11:56.000Z | #!/usr/bin/env python3
import argparse
import os
import sys
import traceback
from lib import core, utilities, run
from lib.attributes import Attributes
from lib.database import Database
def process_arguments():
"""
Uses the argparse module to parse commandline arguments.
Returns:
Dictionary of ... | 26.361702 | 76 | 0.584073 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,218 | 0.327684 |
58e423e71414f032f22c45a5bedf02c030da3667 | 8,423 | py | Python | behave/reporter/summary.py | fluendo/behave | eeffde083456dcf1a0ea9b6139b32091970118c0 | [
"BSD-2-Clause"
] | null | null | null | behave/reporter/summary.py | fluendo/behave | eeffde083456dcf1a0ea9b6139b32091970118c0 | [
"BSD-2-Clause"
] | 2 | 2020-03-21T22:37:54.000Z | 2021-10-04T17:14:14.000Z | behave/reporter/summary.py | fluendo/behave | eeffde083456dcf1a0ea9b6139b32091970118c0 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: UTF-8 -*-
"""
Provides a summary after each test run.
"""
from __future__ import absolute_import, division, print_function
import sys
from time import time as time_now
from behave.model import Rule, ScenarioOutline # MAYBE: Scenario
from behave.model_core import Status
from behave.reporter.base import R... | 34.239837 | 141 | 0.581859 | 4,502 | 0.534489 | 0 | 0 | 0 | 0 | 0 | 0 | 1,959 | 0.232577 |
58e63151e272298d99abe2311270c00ae4f753a6 | 2,109 | py | Python | tests/common/bridgecrew/vulnerability_scanning/conftest.py | vangundy-jason-pfg/checkov | 2fb50908f62390c98dda665f1fa94fe24806b654 | [
"Apache-2.0"
] | 1 | 2021-02-13T15:24:42.000Z | 2021-02-13T15:24:42.000Z | tests/common/bridgecrew/vulnerability_scanning/conftest.py | vangundy-jason-pfg/checkov | 2fb50908f62390c98dda665f1fa94fe24806b654 | [
"Apache-2.0"
] | 7 | 2021-04-12T06:54:07.000Z | 2022-03-21T14:04:14.000Z | tests/common/bridgecrew/vulnerability_scanning/conftest.py | vangundy-jason-pfg/checkov | 2fb50908f62390c98dda665f1fa94fe24806b654 | [
"Apache-2.0"
] | 1 | 2021-12-16T03:09:55.000Z | 2021-12-16T03:09:55.000Z | from typing import Dict, Any
import pytest
from checkov.common.bridgecrew.bc_source import SourceType
from checkov.common.bridgecrew.platform_integration import BcPlatformIntegration, bc_integration
@pytest.fixture()
def mock_bc_integration() -> BcPlatformIntegration:
bc_integration.bc_api_key = "abcd1234-abcd-... | 40.557692 | 120 | 0.579896 | 0 | 0 | 0 | 0 | 1,902 | 0.901849 | 0 | 0 | 963 | 0.456615 |
58e6b8cbdb9f5deb8475e765553e3c1da2be8892 | 1,038 | py | Python | image_matting/modules/trimap_generator/trimap_generator_application.py | image-matting/backend | bbf502539cf70822dadb5eded31529d5e66c6276 | [
"Apache-2.0"
] | 1 | 2022-01-22T04:12:48.000Z | 2022-01-22T04:12:48.000Z | image_matting/modules/trimap_generator/trimap_generator_application.py | image-matting/backend | bbf502539cf70822dadb5eded31529d5e66c6276 | [
"Apache-2.0"
] | 4 | 2021-12-23T14:02:17.000Z | 2022-01-26T18:44:06.000Z | image_matting/modules/trimap_generator/trimap_generator_application.py | image-matting/backend | bbf502539cf70822dadb5eded31529d5e66c6276 | [
"Apache-2.0"
] | null | null | null | import argparse
from pathlib import Path
from cv2 import cv2
from trimap import generate_trimap
from trimap_output_utils import save_trimap_output
def main():
args = parse_args()
image_path = args.image
output_directory_path = args.output
image_path = Path(image_path)
if not image_path.is_file(... | 29.657143 | 113 | 0.739884 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 174 | 0.16763 |
58e6e3920ecb9bb8ae3ccc039500c2bfac35935a | 2,102 | py | Python | tests/test_views.py | Siecje/graphene-django-sentry | b82188f91717211896cc1dbfc1f0e86de3729734 | [
"MIT"
] | 20 | 2019-03-13T15:28:17.000Z | 2022-03-23T09:52:26.000Z | tests/test_views.py | Siecje/graphene-django-sentry | b82188f91717211896cc1dbfc1f0e86de3729734 | [
"MIT"
] | 5 | 2019-06-29T06:41:16.000Z | 2021-06-10T21:05:25.000Z | tests/test_views.py | Siecje/graphene-django-sentry | b82188f91717211896cc1dbfc1f0e86de3729734 | [
"MIT"
] | 2 | 2019-05-30T13:03:23.000Z | 2019-06-17T16:08:39.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from http.client import OK
from unittest.mock import MagicMock, patch
from urllib.parse import urlencode
import graphene_django.views as views
from django.urls import reverse
from graphql import GraphQLError
from graphql.error import GraphQLLocatedError
class CustomExce... | 26.948718 | 65 | 0.706946 | 51 | 0.024263 | 0 | 0 | 1,407 | 0.669363 | 0 | 0 | 445 | 0.211703 |
58e7d15456033fa62d2766b6d09f022fb1eb2ace | 3,137 | py | Python | spacy/lang/nl/stop_words.py | cedar101/spaCy | 66e22098a8bb77cbe527b1a4a3c69ec1cfb56f95 | [
"MIT"
] | 12 | 2019-03-20T20:43:47.000Z | 2020-04-13T11:10:52.000Z | spacy/lang/nl/stop_words.py | cedar101/spaCy | 66e22098a8bb77cbe527b1a4a3c69ec1cfb56f95 | [
"MIT"
] | 13 | 2018-06-05T11:54:40.000Z | 2019-07-02T11:33:14.000Z | spacy/lang/nl/stop_words.py | cedar101/spaCy | 66e22098a8bb77cbe527b1a4a3c69ec1cfb56f95 | [
"MIT"
] | 1 | 2020-05-12T16:00:38.000Z | 2020-05-12T16:00:38.000Z | # coding: utf8
from __future__ import unicode_literals
# The original stop words list (added in f46ffe3) was taken from
# http://www.damienvanholten.com/downloads/dutch-stop-words.txt
# and consisted of about 100 tokens.
# In order to achieve parity with some of the better-supported
# languages, e.g., English, French,... | 42.391892 | 120 | 0.808734 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,057 | 0.973257 |
58e841d7116f44d86fb300ae823c11eb893353a1 | 1,858 | py | Python | liv_covid19/web/artic/opentrons_thread.py | neilswainston/liv-covid19 | 4842fccdca626caca50bd7c545e3f673660503d4 | [
"MIT"
] | 2 | 2020-03-31T12:59:13.000Z | 2021-02-08T21:40:20.000Z | liv_covid19/web/artic/opentrons_thread.py | neilswainston/liv-covid19 | 4842fccdca626caca50bd7c545e3f673660503d4 | [
"MIT"
] | null | null | null | liv_covid19/web/artic/opentrons_thread.py | neilswainston/liv-covid19 | 4842fccdca626caca50bd7c545e3f673660503d4 | [
"MIT"
] | 2 | 2020-06-23T16:49:20.000Z | 2020-06-25T14:59:32.000Z | '''
(c) University of Liverpool 2020
Licensed under the MIT License.
To view a copy of this license, visit <http://opensource.org/licenses/MIT/>..
@author: neilswainston
'''
# pylint: disable=broad-except
import os.path
import tempfile
from liv_covid19.web.artic import opentrons
from liv_covid19.web.job import JobT... | 30.459016 | 77 | 0.595264 | 1,516 | 0.815931 | 0 | 0 | 0 | 0 | 0 | 0 | 372 | 0.200215 |
58e8cb21bea9ec496741309cc75c724289559dd8 | 838 | py | Python | futuquant/common/ft_logger.py | hxhxhx88/futuquant | a1b4a875604f1de451ddde4bfa3e713452482b0a | [
"Apache-2.0"
] | null | null | null | futuquant/common/ft_logger.py | hxhxhx88/futuquant | a1b4a875604f1de451ddde4bfa3e713452482b0a | [
"Apache-2.0"
] | null | null | null | futuquant/common/ft_logger.py | hxhxhx88/futuquant | a1b4a875604f1de451ddde4bfa3e713452482b0a | [
"Apache-2.0"
] | null | null | null | import logging
from datetime import datetime
import os
logger = logging.getLogger('FT')
log_level = logging.INFO
is_file_log = True
# ่ฎพ็ฝฎlogger็levelไธบDEBUG
logger.setLevel(log_level)
# ๅๅปบไธไธช่พๅบๆฅๅฟๅฐๆงๅถๅฐ็StreamHandler
hdr = logging.StreamHandler()
formatter = logging.Formatter(
'%(asctime)s [%(filename)s] %(funcName)s:... | 24.647059 | 70 | 0.731504 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 224 | 0.252252 |
58ecb5c52b1dbb5c09611ce11efbdfb06b5edf51 | 3,946 | py | Python | image_classification/cifar10/cifar10/networking/cifar10_vgg16_model.py | poncos/deeplearning | 0874b22dab05117bcf39ccb4895d513ab6f87861 | [
"MIT"
] | null | null | null | image_classification/cifar10/cifar10/networking/cifar10_vgg16_model.py | poncos/deeplearning | 0874b22dab05117bcf39ccb4895d513ab6f87861 | [
"MIT"
] | null | null | null | image_classification/cifar10/cifar10/networking/cifar10_vgg16_model.py | poncos/deeplearning | 0874b22dab05117bcf39ccb4895d513ab6f87861 | [
"MIT"
] | null | null | null | # Copyright 2018 Esteban Collado.
#
# Licensed under the MIT License
import tensorflow as tf
DEFAULT_VARIABLE_NAMES = ['conv1', 'conv2', 'conv3', 'conv4', 'fc1', 'fc2', 'softmax_linear']
BATCH_SIZE = 200
IMAGE_WIDTH = 32
IMAGE_HEIGHT = 32
IMAGE_DEPTH = 3
NUM_CLASSES = 10
INPUT_PLACEHOLDER = 'X_INPUT'
LABELS_PLACEHO... | 43.362637 | 118 | 0.640902 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 390 | 0.098834 |
58eeedb6cd1adb5de820dbc349b434e1a3735952 | 425 | py | Python | wrappers/Python/sbmlsolver/__init__.py | gitter-badger/sbmlsolver | c92936832297ea1d2ad7f17223b68ada43c8f0b2 | [
"Apache-2.0"
] | null | null | null | wrappers/Python/sbmlsolver/__init__.py | gitter-badger/sbmlsolver | c92936832297ea1d2ad7f17223b68ada43c8f0b2 | [
"Apache-2.0"
] | null | null | null | wrappers/Python/sbmlsolver/__init__.py | gitter-badger/sbmlsolver | c92936832297ea1d2ad7f17223b68ada43c8f0b2 | [
"Apache-2.0"
] | null | null | null | """
The LibRoadRunner SBML Simulation Engine, (c) 2009-2014 Andy Somogyi and Herbert Sauro
LibRoadRunner is an SBML JIT compiler and simulation engine with a variety of analysis
functions. LibRoadRunner is a self contained library which is designed to be integrated
into existing simulation platforms or may be used a s... | 32.692308 | 87 | 0.807059 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 367 | 0.863529 |
58f0ab77666277ac6d3ddc06e53dedb0c6d49f2b | 1,573 | py | Python | classification/tests/test_evidence_mixin.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | 5 | 2021-01-14T03:34:42.000Z | 2022-03-07T15:34:18.000Z | classification/tests/test_evidence_mixin.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | 551 | 2020-10-19T00:02:38.000Z | 2022-03-30T02:18:22.000Z | classification/tests/test_evidence_mixin.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | null | null | null | from classification.models import EvidenceMixin
from classification.models.evidence_mixin import VCStore
class BasicEvidence(EvidenceMixin):
def __init__(self, evidence: VCStore):
self.evidence = evidence
@property
def _evidence(self) -> VCStore:
return self.evidence
# doesn't work with... | 37.452381 | 99 | 0.650985 | 192 | 0.12206 | 0 | 0 | 74 | 0.047044 | 0 | 0 | 1,244 | 0.790846 |
58f0dabb24cb5744c956fc257b97c051c5d3142b | 674 | py | Python | scronsole/widgets/main_screen.py | bastianh/screeps_console_mod | e093cc1e071fae5bdf106674b97e71902fbbb6ff | [
"MIT"
] | 2 | 2017-10-08T19:39:27.000Z | 2017-10-08T19:51:18.000Z | scronsole/widgets/main_screen.py | bastianh/screeps_console_mod | e093cc1e071fae5bdf106674b97e71902fbbb6ff | [
"MIT"
] | null | null | null | scronsole/widgets/main_screen.py | bastianh/screeps_console_mod | e093cc1e071fae5bdf106674b97e71902fbbb6ff | [
"MIT"
] | null | null | null | import urwid
from scronsole.config_manager import ConfigManager
from scronsole.plugin_manager import PluginManager
from scronsole.widgets.main_menu import MainMenu
from scronsole.widgets.server_screen import ServerScreen
class MainScreen(urwid.WidgetPlaceholder):
def __init__(self):
super().__init__(urwi... | 30.636364 | 62 | 0.746291 | 449 | 0.666172 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0.005935 |
58f1e5bfcc6007b51ace335dfbea68c9b539583f | 436 | py | Python | sql/language.py | skylarkgit/sql2java | befd55180969b0ec68e242991c3260272d755cc9 | [
"MIT"
] | 2 | 2019-10-23T08:27:30.000Z | 2019-10-23T09:58:45.000Z | sql/language.py | skylarkgit/sql2java | befd55180969b0ec68e242991c3260272d755cc9 | [
"MIT"
] | null | null | null | sql/language.py | skylarkgit/sql2java | befd55180969b0ec68e242991c3260272d755cc9 | [
"MIT"
] | null | null | null | import re
from csv import reader
def splitEscaped(str, by, escapeChar):
infile = [str]
return reader(infile, delimiter=by, quotechar=escapeChar)
def removeComments(text):
p = r'/\*[^*]*\*+([^/*][^*]*\*+)*/|("(\\.|[^"\\])*"|\'(\\.|[^\'\\])*\'|.[^/"\'\\]*)'
return ''.join(m.group(2) for m in re.finditer... | 31.142857 | 88 | 0.53211 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 106 | 0.243119 |
58f3c7c8febd7b51f53b623ee90e4c562e1d0bd1 | 659 | py | Python | easy_ArrayAdditionI.py | GabrielGhe/CoderbyteChallenges | 5601dbc24c95a65fed04896de2f534417c2e730d | [
"MIT"
] | 1 | 2020-11-04T15:30:18.000Z | 2020-11-04T15:30:18.000Z | easy_ArrayAdditionI.py | GabrielGhe/CoderbyteChallenges | 5601dbc24c95a65fed04896de2f534417c2e730d | [
"MIT"
] | null | null | null | easy_ArrayAdditionI.py | GabrielGhe/CoderbyteChallenges | 5601dbc24c95a65fed04896de2f534417c2e730d | [
"MIT"
] | null | null | null | import itertools
#################################################
# This function will see if there is any #
# possible combination of the numbers in #
# the array that will give the largest number #
#################################################
def ArrayAdditionI(arr):
#sort, remove last ele... | 26.36 | 54 | 0.53566 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 336 | 0.509863 |
58f4750834ad708c962b1818098008a6819ef467 | 1,994 | py | Python | SVM.py | JAMJU/KernelMethod | e52f5a0cfaefa87073facd88220c311709e513e8 | [
"MIT"
] | null | null | null | SVM.py | JAMJU/KernelMethod | e52f5a0cfaefa87073facd88220c311709e513e8 | [
"MIT"
] | null | null | null | SVM.py | JAMJU/KernelMethod | e52f5a0cfaefa87073facd88220c311709e513e8 | [
"MIT"
] | null | null | null | import numpy as np
import quadprog
def quadprog_solve_qp(P, q, G=None, h=None, A=None, b=None):
""" Solve a QP of the form min 1/2xTPx + qTx st Gx < h st Ax=b"""
#qp_G = .5 * (P + P.T) # make sure P is symmetric
qp_G = P
qp_a = -q
if A is not None:
qp_C = -np.vstack([A, G]).T
qp_... | 33.79661 | 119 | 0.57322 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 629 | 0.315446 |
58f7245b5e8f50a694e2a4405f7daff21e842618 | 1,547 | py | Python | util/MalShare.py | cclauss/ph0neutria | 04b6a569d4e707c3de652ba7ad15c1b5223bebcb | [
"Apache-2.0"
] | null | null | null | util/MalShare.py | cclauss/ph0neutria | 04b6a569d4e707c3de652ba7ad15c1b5223bebcb | [
"Apache-2.0"
] | null | null | null | util/MalShare.py | cclauss/ph0neutria | 04b6a569d4e707c3de652ba7ad15c1b5223bebcb | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
from ConfigUtils import getBaseConfig
from LogUtils import getModuleLogger
from StringUtils import isValidUrl, randomString
from urlparse import urlparse
import json
import os
import requests
import sys
cDir = os.path.dirname(os.path.realpath(__file__))
rootDir = os.path.abspath(os.path.join(cDir,... | 29.75 | 129 | 0.661926 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 292 | 0.188752 |
58f785be1e5480e5359e098bb9e3ecdf8b2d4246 | 705 | py | Python | attempt/runner.py | prstolpe/rrc_simulation | b430fe4e575641cdd64945cf57d0dd67a0eea17a | [
"BSD-3-Clause"
] | null | null | null | attempt/runner.py | prstolpe/rrc_simulation | b430fe4e575641cdd64945cf57d0dd67a0eea17a | [
"BSD-3-Clause"
] | null | null | null | attempt/runner.py | prstolpe/rrc_simulation | b430fe4e575641cdd64945cf57d0dd67a0eea17a | [
"BSD-3-Clause"
] | null | null | null |
from attempt.ddpg import HERDDPG, DDPG
import gym
import os
import matplotlib.pyplot as plt
import numpy as np
from tqdm import tqdm
if __name__ == "__main__":
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
env = gym.make('FetchReach-v1')
agent = HERDDPG(env)
for epoch in range(2):
for cycle in tq... | 20.735294 | 44 | 0.64539 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 110 | 0.156028 |
58f82c89b0b711b196471a3d0d54cc05fadd6ef6 | 8,187 | py | Python | src/shogun/base/class_list.cpp.py | srgnuclear/shogun | 33c04f77a642416376521b0cd1eed29b3256ac13 | [
"Ruby",
"MIT"
] | 1 | 2015-11-05T18:31:14.000Z | 2015-11-05T18:31:14.000Z | src/shogun/base/class_list.cpp.py | waderly/shogun | 9288b6fa38e001d63c32188f7f847dadea66e2ae | [
"Ruby",
"MIT"
] | null | null | null | src/shogun/base/class_list.cpp.py | waderly/shogun | 9288b6fa38e001d63c32188f7f847dadea66e2ae | [
"Ruby",
"MIT"
] | null | null | null | #!/usr/bin/env python
# This program 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.
#
# Written (W) 2008-2009 Soeren Sonnenburg
# Cop... | 27.109272 | 130 | 0.693416 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,801 | 0.219983 |
58f8d01058e75992d07c8d9e6c624ed7a5775471 | 771 | py | Python | script/solr_unauthorized_access.py | 5up3rc/Vxscan | 0d2cae446f6502b51596853be3514c7c4c62809c | [
"Apache-2.0"
] | 2 | 2019-12-05T01:58:22.000Z | 2019-12-14T09:19:28.000Z | script/solr_unauthorized_access.py | 5up3rc/Vxscan | 0d2cae446f6502b51596853be3514c7c4c62809c | [
"Apache-2.0"
] | null | null | null | script/solr_unauthorized_access.py | 5up3rc/Vxscan | 0d2cae446f6502b51596853be3514c7c4c62809c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# project = https://github.com/Xyntax/POC-T
# author = [email protected]
"""
Apache Solr ๆชๆๆ่ฎฟ้ฎPoC
(iterate_pathๅฝๆฐไฝฟ็จๅบๆฏ็คบไพ)
Usage
python POC-T.py -s solr-unauth -iF target.txt
python POC-T.py -s solr-unauth -aZ "solr country:cn"
"""
from lib.verify import verify
from lib.rand... | 24.09375 | 95 | 0.608301 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 368 | 0.461731 |
58f91a9f5c9302c8e95efa47c83b819f09e32089 | 1,248 | py | Python | conanfile.py | midurk/conan-rapidxml | df93616a87ba41edd9def914f765fd8eae0007c5 | [
"MIT"
] | null | null | null | conanfile.py | midurk/conan-rapidxml | df93616a87ba41edd9def914f765fd8eae0007c5 | [
"MIT"
] | null | null | null | conanfile.py | midurk/conan-rapidxml | df93616a87ba41edd9def914f765fd8eae0007c5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from conans import ConanFile, tools
import os
class RapiXMLConan(ConanFile):
name = "rapidxml"
version = "1.13"
description = "RapidXml is an attempt to create the fastest XML parser possible"
url = "https://github.com/bincrafters/conan-rapidxml"
home... | 37.818182 | 97 | 0.684295 | 1,152 | 0.923077 | 0 | 0 | 0 | 0 | 0 | 0 | 502 | 0.402244 |
58f92d8b76c80f99fb368b4b75fdb05787830601 | 2,772 | py | Python | src_2d/help/compute_dice.py | xzluo97/MvMM-RegNet | c08d5df14b4a9c4a98c66973ff4950aba7f416e4 | [
"MIT"
] | 19 | 2020-07-14T02:23:58.000Z | 2022-03-15T12:22:49.000Z | src_2d/help/compute_dice.py | xzluo97/MvMM-RegNet | c08d5df14b4a9c4a98c66973ff4950aba7f416e4 | [
"MIT"
] | 4 | 2020-09-25T22:42:40.000Z | 2021-08-25T15:03:29.000Z | src_2d/help/compute_dice.py | xzluo97/MvMM-RegNet | c08d5df14b4a9c4a98c66973ff4950aba7f416e4 | [
"MIT"
] | 7 | 2020-08-29T15:46:13.000Z | 2021-07-16T01:51:28.000Z | """
Compute Dice between test ground truth and predictions from groupwise registration.
"""
import os
import nibabel as nib
import glob
import numpy as np
from core import utils_2d
from core.metrics_2d import OverlapMetrics
def one_hot_label(label, label_intensity):
gt = np.around(label)
n_cl... | 35.538462 | 119 | 0.626623 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 496 | 0.178932 |
58f98f05dc6e23f4ee940bfbe966fafa9a03fa4c | 14,359 | py | Python | farmos_ext/farm.py | applecreekacres/farmos.py.ext | 91db8a6d5532661650869d34c2ff94e1fed02f02 | [
"MIT"
] | null | null | null | farmos_ext/farm.py | applecreekacres/farmos.py.ext | 91db8a6d5532661650869d34c2ff94e1fed02f02 | [
"MIT"
] | 46 | 2021-02-21T21:05:07.000Z | 2022-03-15T23:05:25.000Z | farmos_ext/farm.py | applecreekacres/farmos.py.ext | 91db8a6d5532661650869d34c2ff94e1fed02f02 | [
"MIT"
] | null | null | null | """Main farm access."""
from __future__ import annotations
import os
from datetime import datetime
from typing import Dict, Iterable, Iterator, List, Type, Union
from farmos_ext.area import Area
from farmos_ext.asset import Asset, Equipment, Planting
from farmos_ext.log import (Activity, Birth, Harvest, Input, Log, ... | 37.393229 | 109 | 0.537503 | 13,514 | 0.941152 | 2,349 | 0.163591 | 701 | 0.04882 | 0 | 0 | 2,636 | 0.183578 |
58f9aedfba7b25435acbe41455b6f6873bd36f40 | 2,768 | py | Python | tests/io/v3/base/test_csv_iterator.py | alpesh-te/pyTenable | 4b5381a7757561f7ac1e79c2e2679356dd533540 | [
"MIT"
] | null | null | null | tests/io/v3/base/test_csv_iterator.py | alpesh-te/pyTenable | 4b5381a7757561f7ac1e79c2e2679356dd533540 | [
"MIT"
] | 25 | 2021-11-16T18:41:36.000Z | 2022-03-25T05:43:31.000Z | tests/io/v3/base/test_csv_iterator.py | alpesh-te/pyTenable | 4b5381a7757561f7ac1e79c2e2679356dd533540 | [
"MIT"
] | 2 | 2022-03-02T12:24:40.000Z | 2022-03-29T05:12:04.000Z | '''
Testing the CSV iterators
'''
import responses
from tenable.io.v3.base.iterators.explore_iterator import CSVChunkIterator
USERS_BASE_URL = r'https://cloud.tenable.com/api/v3/assets/search'
CSV_TEXT = (
'created,display_ipv4_address,first_observed,id,'
'ipv4_addresses,ipv6_addresses,is_deleted,is_license... | 35.948052 | 74 | 0.695087 | 0 | 0 | 0 | 0 | 387 | 0.139812 | 0 | 0 | 1,985 | 0.717124 |
58fae9bfd3e0a20200a7b3dc48f407ee12665c55 | 246 | py | Python | import_new_tournaments/process_hh_files/process/hands/extract/position_info/extract_stack_from_seat_line.py | michaelcukier/Poker-Hand-Tracker | 9adae42fab9f640e6939ba06bd588ab1a2feb90f | [
"MIT"
] | 5 | 2021-02-28T18:33:02.000Z | 2022-03-12T01:43:40.000Z | import_new_tournaments/process_hh_files/process/hands/extract/position_info/extract_stack_from_seat_line.py | michaelcukier/Poker-Hand-Tracker | 9adae42fab9f640e6939ba06bd588ab1a2feb90f | [
"MIT"
] | null | null | null | import_new_tournaments/process_hh_files/process/hands/extract/position_info/extract_stack_from_seat_line.py | michaelcukier/Poker-Hand-Tracker | 9adae42fab9f640e6939ba06bd588ab1a2feb90f | [
"MIT"
] | 2 | 2021-03-01T03:08:04.000Z | 2021-12-31T17:53:46.000Z | def extract_stack_from_seat_line(seat_line: str) -> float or None:
# Seat 3: PokerPete24 (40518.00)
if 'will be allowed to play after the button' in seat_line:
return None
return float(seat_line.split(' (')[1].split(')')[0])
| 35.142857 | 66 | 0.670732 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 81 | 0.329268 |
58fb3efb05d44bd1aa9c7179a47db0c343140765 | 3,716 | py | Python | startt.py | OnyyMexicanCat/RinkoglionitoBot | 12e48e679b46710bbeaa7e98f02b09a512609031 | [
"MIT"
] | null | null | null | startt.py | OnyyMexicanCat/RinkoglionitoBot | 12e48e679b46710bbeaa7e98f02b09a512609031 | [
"MIT"
] | null | null | null | startt.py | OnyyMexicanCat/RinkoglionitoBot | 12e48e679b46710bbeaa7e98f02b09a512609031 | [
"MIT"
] | null | null | null | from telegram.ext import *
from telegram import *
import time
def start(update, context):
context.bot.send_message(chat_id=update.effective_chat.id, text="Hi ๐ I'm Rinkoglionito and I'm here because @OnyyTheBest had nothing to do ;-;. \n that said do the /cmds command to see the available commands")
cha... | 62.983051 | 655 | 0.660388 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,630 | 0.421297 |
58fb480ae327d41355b8b8179c7dede058c21b5b | 222 | py | Python | server/config.py | nikitinivan/Crypton | 90db77f4066d763e55f55c0fb540dc99aa2495e3 | [
"MIT"
] | null | null | null | server/config.py | nikitinivan/Crypton | 90db77f4066d763e55f55c0fb540dc99aa2495e3 | [
"MIT"
] | null | null | null | server/config.py | nikitinivan/Crypton | 90db77f4066d763e55f55c0fb540dc99aa2495e3 | [
"MIT"
] | null | null | null | import os
class Configuration:
APPLICATION_DIR = os.path.dirname(os.path.realpath(__file__))
DEBUG = True
SECRET_KEY = 'thisissecretkeyforcrypton' # change it in production !!!
MONGO_DBNAME = 'cryptondb'
| 24.666667 | 74 | 0.725225 | 209 | 0.941441 | 0 | 0 | 0 | 0 | 0 | 0 | 67 | 0.301802 |
58fc01c36853b26f8562e022eac13585ff61105f | 69 | py | Python | nbviewerbot/__main__.py | JohnPaton/nbviewerbot | a9564655ba041e53db9a6916fb424e9582704321 | [
"MIT"
] | 7 | 2018-08-06T20:02:13.000Z | 2021-04-12T06:04:46.000Z | nbviewerbot/__main__.py | JohnPaton/nbviewerbot | a9564655ba041e53db9a6916fb424e9582704321 | [
"MIT"
] | 5 | 2018-09-13T20:53:32.000Z | 2021-03-31T18:55:48.000Z | nbviewerbot/__main__.py | JohnPaton/nbviewerbot | a9564655ba041e53db9a6916fb424e9582704321 | [
"MIT"
] | null | null | null | import nbviewerbot
if __name__ == "__main__":
nbviewerbot.cli()
| 13.8 | 26 | 0.710145 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 0.144928 |
58fd05c379e33e35d0b95e61f85e13decd24ff2f | 1,571 | py | Python | fetch_data.py | ASabryMazroua/Arabic-Dialect-Classification | e0e778379a321022d4d05b54b067ab6541793434 | [
"MIT"
] | 1 | 2022-03-19T04:40:27.000Z | 2022-03-19T04:40:27.000Z | fetch_data.py | ASabryMazroua/Arabic-Dialect-Classification | e0e778379a321022d4d05b54b067ab6541793434 | [
"MIT"
] | null | null | null | fetch_data.py | ASabryMazroua/Arabic-Dialect-Classification | e0e778379a321022d4d05b54b067ab6541793434 | [
"MIT"
] | null | null | null | import json
import math
import requests
import pandas as pd
def fetch_data(ids):
'''
A function to fetch data from the API.
Parameters:
ids (list): A list of ids (integrs) to fetch
Returns:
text (dict): A dictionary where keys are the ids and values are the... | 38.317073 | 89 | 0.624443 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 857 | 0.545512 |
58fd528adc4ec458f11e0462bce2b5ed5cc03175 | 2,305 | py | Python | tests/test.py | daniel-sasu/roadwatch-data-processor | 10317998a7f336bd1a26dc95b54e7bb7785cfd22 | [
"MIT"
] | null | null | null | tests/test.py | daniel-sasu/roadwatch-data-processor | 10317998a7f336bd1a26dc95b54e7bb7785cfd22 | [
"MIT"
] | null | null | null | tests/test.py | daniel-sasu/roadwatch-data-processor | 10317998a7f336bd1a26dc95b54e7bb7785cfd22 | [
"MIT"
] | null | null | null | # tests/test.py
from rw_data_proc.core import *
import unittest
def _dummyModifierFunction(row):
row['adr'] = 'modified'
return row['adr']
class TableTest(unittest.TestCase):
def test_init(self):
tb = Table('tests/test_file.csv')
self.assertIsNotNone(tb)
def test_add_modifier(self)... | 39.741379 | 107 | 0.610846 | 2,153 | 0.934056 | 0 | 0 | 0 | 0 | 0 | 0 | 376 | 0.163124 |
58fdec912e446a48a537a766eb98ce253951af60 | 1,496 | py | Python | booking_spaces/booking/forms.py | pvlvnk/booking | 701c8e1d8ceefde03090cd93bf954874d9fe349e | [
"MIT"
] | null | null | null | booking_spaces/booking/forms.py | pvlvnk/booking | 701c8e1d8ceefde03090cd93bf954874d9fe349e | [
"MIT"
] | null | null | null | booking_spaces/booking/forms.py | pvlvnk/booking | 701c8e1d8ceefde03090cd93bf954874d9fe349e | [
"MIT"
] | null | null | null | from booking.models import Schedule, ParkingSpace
from datetime import datetime as dt
from django import forms
class ReservingForm(forms.ModelForm):
reserving_dates = forms.ModelMultipleChoiceField(
queryset=Schedule.objects.filter(reserving_date__gte=dt.today()),
widget=forms.CheckboxSelectMult... | 24.933333 | 73 | 0.68115 | 1,366 | 0.913102 | 0 | 0 | 0 | 0 | 0 | 0 | 103 | 0.06885 |
58ff16ed56b02ccd24c5cca15503e57704dd6fd0 | 20,793 | py | Python | tests/unit/aiplatform/test_matching_engine_index_endpoint.py | kthytang/python-aiplatform | e82c1792293396045a1032df015a3700fc38609b | [
"Apache-2.0"
] | null | null | null | tests/unit/aiplatform/test_matching_engine_index_endpoint.py | kthytang/python-aiplatform | e82c1792293396045a1032df015a3700fc38609b | [
"Apache-2.0"
] | null | null | null | tests/unit/aiplatform/test_matching_engine_index_endpoint.py | kthytang/python-aiplatform | e82c1792293396045a1032df015a3700fc38609b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 33.537097 | 90 | 0.67994 | 9,216 | 0.443226 | 5,980 | 0.287597 | 15,385 | 0.739912 | 0 | 0 | 2,238 | 0.107632 |
58ff85cb63e954368b68902aa3d1e1f0e1df7bef | 1,440 | py | Python | vrc_log_viewer.py | 27Cobalter/vrc_log_viewer | 00b5d106488fb95c605ef873a75fd26bd7d1d37f | [
"MIT"
] | 2 | 2019-08-29T05:58:22.000Z | 2019-09-09T15:29:16.000Z | vrc_log_viewer.py | 27Cobalter/vrc_log_viewer | 00b5d106488fb95c605ef873a75fd26bd7d1d37f | [
"MIT"
] | 1 | 2022-03-20T08:11:00.000Z | 2022-03-20T08:11:00.000Z | vrc_log_viewer.py | 27Cobalter/vrc_log_viewer | 00b5d106488fb95c605ef873a75fd26bd7d1d37f | [
"MIT"
] | 2 | 2020-02-04T03:19:57.000Z | 2021-02-08T15:17:22.000Z | import glob
import os
import re
import sys
import time
import yaml
def tail(thefile, past):
if not past:
thefile.seek(0, 2)
while True:
line = thefile.readline()
if not line:
time.sleep(0.5)
continue
line = line.rstrip("\n").rstrip("\r")
if line ... | 27.169811 | 80 | 0.532639 | 0 | 0 | 292 | 0.202778 | 0 | 0 | 0 | 0 | 174 | 0.120833 |
450019e12b1cc5c40f3f6bff8bbb906c38cceb65 | 9,032 | py | Python | src/intermediate_representation/sem2sql/infer_from_clause.py | brunnurs/proton | 057889e2bcefd2e7e6bc3b0fcdf418a2123767a0 | [
"Apache-2.0"
] | null | null | null | src/intermediate_representation/sem2sql/infer_from_clause.py | brunnurs/proton | 057889e2bcefd2e7e6bc3b0fcdf418a2123767a0 | [
"Apache-2.0"
] | null | null | null | src/intermediate_representation/sem2sql/infer_from_clause.py | brunnurs/proton | 057889e2bcefd2e7e6bc3b0fcdf418a2123767a0 | [
"Apache-2.0"
] | null | null | null | def infer_from_clause(table_names, graph, columns):
tables = list(table_names.keys())
if len(tables) == 1: # no JOINS needed - just return the simple "FROM" clause.
return f"FROM {tables[0]} "
else: # we have to deal with multiple tables - and find the shortest path between them
join_clau... | 45.616162 | 175 | 0.665633 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4,066 | 0.450177 |
450109704aaa9e57ec8952a08e13c1c362e0340c | 21 | py | Python | test.py | AlanFnz/profiles-rest-api | c606999f86235ed74fd98421bd02bc598d5a5463 | [
"MIT"
] | null | null | null | test.py | AlanFnz/profiles-rest-api | c606999f86235ed74fd98421bd02bc598d5a5463 | [
"MIT"
] | null | null | null | test.py | AlanFnz/profiles-rest-api | c606999f86235ed74fd98421bd02bc598d5a5463 | [
"MIT"
] | null | null | null | print('Test script')
| 10.5 | 20 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 0.619048 |
45022a2b63c33a9252e7e2198671dfbcf5309e06 | 2,208 | py | Python | src/markdown_storage/folder.py | stephanpoetschner/markdown_storage | 69005db4484010e0d2282bdeb0d0bcc30a316932 | [
"MIT"
] | null | null | null | src/markdown_storage/folder.py | stephanpoetschner/markdown_storage | 69005db4484010e0d2282bdeb0d0bcc30a316932 | [
"MIT"
] | null | null | null | src/markdown_storage/folder.py | stephanpoetschner/markdown_storage | 69005db4484010e0d2282bdeb0d0bcc30a316932 | [
"MIT"
] | null | null | null | import os
from .exceptions import MarkdownError, MetadataError
from .file import ContentFile
class ContentFolder(object):
def __init__(self, path):
path = os.path.abspath(path)
self._path = path
self._files = []
self._folders = []
for filename in os.listdir(self._path):
... | 24 | 62 | 0.579257 | 1,601 | 0.725091 | 152 | 0.068841 | 180 | 0.081522 | 0 | 0 | 717 | 0.324728 |
4506dc61f56a8eae8242703dae9838d15d5a49a2 | 2,327 | py | Python | test/test_session.py | Sunmxt/UESTC-EAMS | 760a7387a5d73967e45a0b9d211acb383bb50fe1 | [
"Apache-2.0"
] | 1 | 2020-07-25T13:53:35.000Z | 2020-07-25T13:53:35.000Z | test/test_session.py | Sunmxt/UESTC-EAMS | 760a7387a5d73967e45a0b9d211acb383bb50fe1 | [
"Apache-2.0"
] | null | null | null | test/test_session.py | Sunmxt/UESTC-EAMS | 760a7387a5d73967e45a0b9d211acb383bb50fe1 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/python
'''
Test for session module
'''
import unittest
import uestc_eams
from .mock_server import LoginMockServer
from .utils import HookedMethod, MakeResponse
mock_login = LoginMockServer()
class TestSession(unittest.TestCase):
@mock_login.Patch
def test_Session(self):
self.__s... | 34.731343 | 77 | 0.65578 | 2,107 | 0.905458 | 0 | 0 | 2,063 | 0.886549 | 0 | 0 | 618 | 0.265578 |
4507d40889bdeb2efc06f9fd94721d09e699f4c0 | 159 | py | Python | Asignacion2/App/main.py | HarambeGeek/uip-iq-pc3 | 6e9a0678a90c4bfd7499dfb5c71c9a3ea9effe1e | [
"Apache-2.0"
] | null | null | null | Asignacion2/App/main.py | HarambeGeek/uip-iq-pc3 | 6e9a0678a90c4bfd7499dfb5c71c9a3ea9effe1e | [
"Apache-2.0"
] | null | null | null | Asignacion2/App/main.py | HarambeGeek/uip-iq-pc3 | 6e9a0678a90c4bfd7499dfb5c71c9a3ea9effe1e | [
"Apache-2.0"
] | null | null | null | from App.numeros import numeros
if __name__ == "__main__":
x = int(input("Ingrese el nรบmero que desea evaluar: \n"))
pi = numeros(x)
pi.parImpar() | 26.5 | 61 | 0.660377 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 52 | 0.325 |
45085ba62031c2ca173669eca6938ca7aaf578c8 | 6,950 | py | Python | tensorflow/python/distribute/test_util.py | TL-Rubick/tensorflow | 6cf1ccf6060a95aad3ccc84544d0aa166990ec72 | [
"Apache-2.0"
] | 11 | 2018-01-03T15:11:09.000Z | 2021-04-13T05:47:27.000Z | tensorflow/python/distribute/test_util.py | TL-Rubick/tensorflow | 6cf1ccf6060a95aad3ccc84544d0aa166990ec72 | [
"Apache-2.0"
] | 88 | 2020-11-24T08:18:10.000Z | 2022-03-25T20:28:30.000Z | tensorflow/python/distribute/test_util.py | TL-Rubick/tensorflow | 6cf1ccf6060a95aad3ccc84544d0aa166990ec72 | [
"Apache-2.0"
] | 10 | 2018-07-31T10:56:21.000Z | 2019-10-07T08:05:21.000Z | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 36.010363 | 80 | 0.726475 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,027 | 0.43554 |
4508cb0373bf214606e00078a7d58793158e28a1 | 3,928 | py | Python | experiment_data_handler.py | grdddj/Diploma-Thesis---Inverse-Heat-Transfer | 636182fa4c57913002675ed3afca8c1b3dc35e1c | [
"MIT"
] | 2 | 2019-09-09T18:49:14.000Z | 2021-11-15T23:41:00.000Z | experiment_data_handler.py | grdddj/Diploma-Thesis---Inverse-Heat-Transfer | 636182fa4c57913002675ed3afca8c1b3dc35e1c | [
"MIT"
] | null | null | null | experiment_data_handler.py | grdddj/Diploma-Thesis---Inverse-Heat-Transfer | 636182fa4c57913002675ed3afca8c1b3dc35e1c | [
"MIT"
] | null | null | null | import csv
class ExperimentDataCannotBeParsedError(Exception):
"""
Defining custom exception type that will be thrown when something fails here
"""
def __init__(self, msg: str = "ERROR"):
self.message = msg
def __str__(self):
"""
Defines what to show when exception is pri... | 38.509804 | 118 | 0.621436 | 3,908 | 0.994908 | 0 | 0 | 0 | 0 | 0 | 0 | 1,958 | 0.498473 |
450a6b5edd6e30d83bb61609d61f4702dee03bf9 | 23,457 | py | Python | hybrideb/_bineb.py | beckermr/hybrideb | a72d712020943dbbed35cb244f9e7f13fc6b2d4d | [
"BSD-3-Clause"
] | null | null | null | hybrideb/_bineb.py | beckermr/hybrideb | a72d712020943dbbed35cb244f9e7f13fc6b2d4d | [
"BSD-3-Clause"
] | null | null | null | hybrideb/_bineb.py | beckermr/hybrideb | a72d712020943dbbed35cb244f9e7f13fc6b2d4d | [
"BSD-3-Clause"
] | null | null | null | import sys
import numpy as np
import scipy.integrate
import scipy.special
from ._dblquad import dblquad
HAVE_PYGSL = False
try:
import pygsl.integrate
import pygsl.sf
HAVE_PYGSL = True
except ImportError:
pass
class BinEB(object):
def __init__(
self, tmin, tmax, Nb, windows=None, linear... | 34.394428 | 87 | 0.336488 | 23,225 | 0.99011 | 0 | 0 | 0 | 0 | 0 | 0 | 1,891 | 0.080616 |
450a8b0c8c6133dd03a986ca11b5d16bc7850c24 | 9,945 | py | Python | test_fast_ndimage.py | grlee77/skimage_accel_demos | 96606ca27c8c622733958c01620bc55e616319db | [
"BSD-3-Clause"
] | null | null | null | test_fast_ndimage.py | grlee77/skimage_accel_demos | 96606ca27c8c622733958c01620bc55e616319db | [
"BSD-3-Clause"
] | null | null | null | test_fast_ndimage.py | grlee77/skimage_accel_demos | 96606ca27c8c622733958c01620bc55e616319db | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from numpy.testing import assert_allclose, run_module_suite
from fast_ndimage import (
median_filter, sobel, convolve, correlate, gaussian_filter,
gaussian_filter1d, uniform_filter, uniform_filter1d)
def test_median_filter():
rtol = atol = 1e-7
shape = (63, 64)
rstate = np.rando... | 44.2 | 173 | 0.627954 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,108 | 0.211966 |
450aba433942ebcf2d5698d6bec5bdbf826e634d | 628 | py | Python | RecamanSequence/recaman_sequence.py | urosjevremovic/Recamans-Sequence | ab6a90c363271dc842f26ccd1b69168a9764de9e | [
"MIT"
] | null | null | null | RecamanSequence/recaman_sequence.py | urosjevremovic/Recamans-Sequence | ab6a90c363271dc842f26ccd1b69168a9764de9e | [
"MIT"
] | null | null | null | RecamanSequence/recaman_sequence.py | urosjevremovic/Recamans-Sequence | ab6a90c363271dc842f26ccd1b69168a9764de9e | [
"MIT"
] | null | null | null | import sys
from itertools import count, islice
def sequence():
"""Generate Recaman's sequence"""
seen = set()
a = 0
for n in count(1):
yield a
seen.add(a)
c = a - n
if c < 0 or c in seen:
c = a + n
a = c
def write_sequence(num):
"""Write Recama... | 20.258065 | 63 | 0.565287 | 0 | 0 | 224 | 0.356688 | 0 | 0 | 0 | 0 | 120 | 0.191083 |
450b1dc0c660308c26a032b98dc820700aea0504 | 533 | py | Python | 2018/aoc/d8/test.py | lukaselmer/adventofcode | b96ffc9040b63b338bca653830ba4ff7e90a8b2a | [
"MIT"
] | 1 | 2018-12-12T22:59:44.000Z | 2018-12-12T22:59:44.000Z | 2018/aoc/d8/test.py | lukaselmer/adventofcode | b96ffc9040b63b338bca653830ba4ff7e90a8b2a | [
"MIT"
] | null | null | null | 2018/aoc/d8/test.py | lukaselmer/adventofcode | b96ffc9040b63b338bca653830ba4ff7e90a8b2a | [
"MIT"
] | null | null | null | import unittest
from unittest.mock import mock_open, patch
from aoc.d8.main import metadata_sum, supervalue
DATA = "2 3 0 3 10 11 12 1 1 0 1 99 2 1 1 2\n"
class TestCase(unittest.TestCase):
def test_metadata_sum(self):
with patch("builtins.open", mock_open(read_data=DATA)):
self.assertEqual(... | 25.380952 | 63 | 0.682927 | 324 | 0.60788 | 0 | 0 | 0 | 0 | 0 | 0 | 79 | 0.148218 |
450b884de08b19e1126451db4abb472fc660d42a | 955 | py | Python | tests/calculators/openbabel/test_obabel_calculators.py | stevenbennett96/stko | ee340af4fc549d5a2c3e9cba8360661335efe0fd | [
"MIT"
] | null | null | null | tests/calculators/openbabel/test_obabel_calculators.py | stevenbennett96/stko | ee340af4fc549d5a2c3e9cba8360661335efe0fd | [
"MIT"
] | null | null | null | tests/calculators/openbabel/test_obabel_calculators.py | stevenbennett96/stko | ee340af4fc549d5a2c3e9cba8360661335efe0fd | [
"MIT"
] | 2 | 2020-05-08T17:51:25.000Z | 2020-05-11T09:03:24.000Z | import stko
import pytest
try:
from openbabel import openbabel
except ImportError:
openbabel = None
def test_open_babel_energy(unoptimized_mol):
if openbabel is None:
with pytest.raises(stko.WrapperNotInstalledException):
calculator = stko.OpenBabelEnergy('uff')
else:
ca... | 29.84375 | 62 | 0.709948 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 34 | 0.035602 |
450c6f3fc4e2b60e9dc2c7675ce23445e63cfa2b | 1,773 | py | Python | psono/restapi/views/membership_decline.py | dirigeant/psono-server | a18c5b3c4d8bbbe4ecf1615b210d99fb77752205 | [
"Apache-2.0",
"CC0-1.0"
] | 48 | 2018-04-19T15:50:58.000Z | 2022-01-23T15:58:11.000Z | psono/restapi/views/membership_decline.py | dirigeant/psono-server | a18c5b3c4d8bbbe4ecf1615b210d99fb77752205 | [
"Apache-2.0",
"CC0-1.0"
] | 9 | 2018-09-13T14:56:18.000Z | 2020-01-17T16:44:33.000Z | psono/restapi/views/membership_decline.py | dirigeant/psono-server | a18c5b3c4d8bbbe4ecf1615b210d99fb77752205 | [
"Apache-2.0",
"CC0-1.0"
] | 11 | 2019-09-20T11:53:47.000Z | 2021-07-18T22:41:31.000Z | from rest_framework import status
from rest_framework.response import Response
from rest_framework.generics import GenericAPIView
from ..permissions import IsAuthenticated
from django.core.cache import cache
from django.conf import settings
from ..authentication import TokenAuthentication
from ..app_settings import (... | 30.568966 | 106 | 0.693739 | 1,414 | 0.797518 | 0 | 0 | 0 | 0 | 0 | 0 | 293 | 0.165257 |
450c825cc3c91a3ffe9479b87c3868422b01ed4b | 5,350 | py | Python | tests/data/samplers/bucket_batch_sampler_test.py | MSLars/allennlp | 2cdb8742c8c8c3c38ace4bdfadbdc750a1aa2475 | [
"Apache-2.0"
] | 11,433 | 2017-06-27T03:08:46.000Z | 2022-03-31T18:14:33.000Z | tests/data/samplers/bucket_batch_sampler_test.py | MSLars/allennlp | 2cdb8742c8c8c3c38ace4bdfadbdc750a1aa2475 | [
"Apache-2.0"
] | 4,006 | 2017-06-26T21:45:43.000Z | 2022-03-31T02:11:10.000Z | tests/data/samplers/bucket_batch_sampler_test.py | MSLars/allennlp | 2cdb8742c8c8c3c38ace4bdfadbdc750a1aa2475 | [
"Apache-2.0"
] | 2,560 | 2017-06-26T21:16:53.000Z | 2022-03-30T07:55:46.000Z | from allennlp.common import Params
from allennlp.data import Instance, Token, Batch
from allennlp.data.fields import TextField
from allennlp.data.samplers import BucketBatchSampler
from allennlp.data.data_loaders import MultiProcessDataLoader
from .sampler_test import SamplerTest
class TestBucketSampler(SamplerTest)... | 35.90604 | 95 | 0.601121 | 5,065 | 0.946729 | 0 | 0 | 0 | 0 | 0 | 0 | 510 | 0.095327 |
45112f2abb035e911415cb428c007f107a543914 | 3,332 | py | Python | tests/test_sphere.py | dkirkby/batoid | 734dccc289eb7abab77a62cdc14563ed5981753b | [
"BSD-2-Clause"
] | null | null | null | tests/test_sphere.py | dkirkby/batoid | 734dccc289eb7abab77a62cdc14563ed5981753b | [
"BSD-2-Clause"
] | null | null | null | tests/test_sphere.py | dkirkby/batoid | 734dccc289eb7abab77a62cdc14563ed5981753b | [
"BSD-2-Clause"
] | null | null | null | import batoid
import numpy as np
import math
from test_helpers import timer, do_pickle, all_obj_diff
@timer
def test_properties():
import random
random.seed(5)
for i in range(100):
R = random.gauss(0.7, 0.8)
sphere = batoid.Sphere(R)
assert sphere.R == R
do_pickle(sphere)
... | 28.237288 | 88 | 0.545618 | 0 | 0 | 0 | 0 | 3,064 | 0.919568 | 0 | 0 | 257 | 0.077131 |
4511821928e83d509f748b6119d6ba8794c26a88 | 2,678 | py | Python | site_stats/middlewares.py | ganlvtech/blueking-django-startup-project | 042aa36b0757c0d3929d88bc23534f54963d333e | [
"MIT"
] | 1 | 2018-11-22T21:13:25.000Z | 2018-11-22T21:13:25.000Z | site_stats/middlewares.py | ganlvtech/blueking-django-startup-project | 042aa36b0757c0d3929d88bc23534f54963d333e | [
"MIT"
] | null | null | null | site_stats/middlewares.py | ganlvtech/blueking-django-startup-project | 042aa36b0757c0d3929d88bc23534f54963d333e | [
"MIT"
] | null | null | null | from django.http.response import HttpResponseForbidden
from .models import Counter, VisitLog
from .utils import get_client_ip
class SiteStatistics(object):
visit_log = None
def process_request(self, request):
if request.path_info.startswith('/admin/'):
return
counter = Counter.o... | 34.779221 | 79 | 0.596341 | 2,545 | 0.950336 | 0 | 0 | 0 | 0 | 0 | 0 | 223 | 0.083271 |
4511a28651e9a1abc5a51540a0f550556e34f6c9 | 1,753 | py | Python | gpu_bdb/bdb_tools/q24_utils.py | VibhuJawa/gpu-bdb | 13987b4ef8b92db3b9d2905dec7bd2fd81f42ae9 | [
"Apache-2.0"
] | 62 | 2020-05-14T13:33:02.000Z | 2020-10-29T13:28:26.000Z | gpu_bdb/bdb_tools/q24_utils.py | VibhuJawa/gpu-bdb | 13987b4ef8b92db3b9d2905dec7bd2fd81f42ae9 | [
"Apache-2.0"
] | 104 | 2020-07-01T21:07:42.000Z | 2020-11-13T16:36:04.000Z | gpu_bdb/bdb_tools/q24_utils.py | VibhuJawa/gpu-bdb | 13987b4ef8b92db3b9d2905dec7bd2fd81f42ae9 | [
"Apache-2.0"
] | 21 | 2020-05-14T14:44:40.000Z | 2020-11-07T12:08:28.000Z | #
# Copyright (c) 2019-2022, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 34.372549 | 75 | 0.714775 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 930 | 0.530519 |
451235b4dc66c44ae6da7b46c7877673b9a0d562 | 8,175 | py | Python | tests/test_compare.py | mys-lang/mys | 070431fdedd7a6bf537f3a30583cd44f644cdbf4 | [
"MIT"
] | 59 | 2021-01-06T14:21:40.000Z | 2022-02-22T21:49:39.000Z | tests/test_compare.py | mys-lang/mys | 070431fdedd7a6bf537f3a30583cd44f644cdbf4 | [
"MIT"
] | 31 | 2021-01-05T00:32:36.000Z | 2022-02-23T13:34:33.000Z | tests/test_compare.py | mys-lang/mys | 070431fdedd7a6bf537f3a30583cd44f644cdbf4 | [
"MIT"
] | 7 | 2021-01-03T11:53:03.000Z | 2022-02-22T17:49:42.000Z | from .utils import TestCase
from .utils import build_and_test_module
from .utils import transpile_source
class Test(TestCase):
def test_compare(self):
with self.assertRaises(SystemExit):
build_and_test_module('compare')
def test_assert_between(self):
self.assert_transpile_raises(... | 34.493671 | 78 | 0.416147 | 8,067 | 0.986789 | 0 | 0 | 0 | 0 | 0 | 0 | 3,998 | 0.489052 |
4512ba1f9249887e49626300dacbdb0fac5b7fbe | 170 | py | Python | epidemioptim/environments/cost_functions/costs/__init__.py | goodhamgupta/EpidemiOptim | a4fe3fcfc2d82a10db16a168526982c03ca2c8d3 | [
"MIT"
] | null | null | null | epidemioptim/environments/cost_functions/costs/__init__.py | goodhamgupta/EpidemiOptim | a4fe3fcfc2d82a10db16a168526982c03ca2c8d3 | [
"MIT"
] | null | null | null | epidemioptim/environments/cost_functions/costs/__init__.py | goodhamgupta/EpidemiOptim | a4fe3fcfc2d82a10db16a168526982c03ca2c8d3 | [
"MIT"
] | null | null | null | from epidemioptim.environments.cost_functions.costs.death_toll_cost import DeathToll
from epidemioptim.environments.cost_functions.costs.gdp_recess_cost import GdpRecess
| 56.666667 | 84 | 0.905882 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
451354227c3d203ff804c452ae15b439b4e8924c | 1,587 | py | Python | BFS/70.py | wilbertgeng/LintCode_exercise | e7a343b746e98ca3b4bc7b36655af7291f3150db | [
"MIT"
] | null | null | null | BFS/70.py | wilbertgeng/LintCode_exercise | e7a343b746e98ca3b4bc7b36655af7291f3150db | [
"MIT"
] | null | null | null | BFS/70.py | wilbertgeng/LintCode_exercise | e7a343b746e98ca3b4bc7b36655af7291f3150db | [
"MIT"
] | null | null | null | """70 ยท Binary Tree Level Order Traversal II"""
"""
Definition of TreeNode:
class TreeNode:
def __init__(self, val):
self.val = val
self.left, self.right = None, None
"""
class Solution:
"""
@param root: A tree
@return: buttom-up level order a list of lists of integer
"""
def le... | 24.415385 | 61 | 0.477001 | 1,394 | 0.877834 | 0 | 0 | 0 | 0 | 0 | 0 | 312 | 0.196474 |
451370b67d994c4274e51949234d8fd9c7be285d | 2,554 | py | Python | yuque_py/clients/client.py | kingJiaYouwen/yuque-py | 451ec6b88860a984de9456d48c0af341676513a3 | [
"MIT"
] | null | null | null | yuque_py/clients/client.py | kingJiaYouwen/yuque-py | 451ec6b88860a984de9456d48c0af341676513a3 | [
"MIT"
] | null | null | null | yuque_py/clients/client.py | kingJiaYouwen/yuque-py | 451ec6b88860a984de9456d48c0af341676513a3 | [
"MIT"
] | null | null | null | import typing
import requests
from urllib.parse import urlencode
from .abstract_client import AbstractClient
from yuque_py.exceptions.request_error import RequestError
class Client(AbstractClient):
api_host: str
user_token: str
def __init__(self, api_host: str, user_token: str) -> None:
self.ap... | 32.74359 | 85 | 0.643696 | 2,381 | 0.932263 | 0 | 0 | 1,161 | 0.454581 | 0 | 0 | 193 | 0.075568 |
45138db5ed51843c9a5afaaec91f905c3ac8de23 | 671 | py | Python | results/views/sports.py | JukkaKarvonen/sal-kiti | 3dcff71552ab323e3c97eccf502c0d72eb683967 | [
"MIT"
] | 1 | 2021-06-12T08:46:32.000Z | 2021-06-12T08:46:32.000Z | results/views/sports.py | JukkaKarvonen/sal-kiti | 3dcff71552ab323e3c97eccf502c0d72eb683967 | [
"MIT"
] | 8 | 2020-07-01T15:06:52.000Z | 2022-02-20T09:11:23.000Z | results/views/sports.py | JukkaKarvonen/sal-kiti | 3dcff71552ab323e3c97eccf502c0d72eb683967 | [
"MIT"
] | 3 | 2020-03-01T17:02:24.000Z | 2020-07-05T14:37:59.000Z | from dry_rest_permissions.generics import DRYPermissions
from rest_framework import viewsets
from results.models.sports import Sport
from results.serializers.sports import SportSerializer
class SportViewSet(viewsets.ModelViewSet):
"""API endpoint for sports.
list:
Returns a list of all the existing spor... | 20.96875 | 56 | 0.728763 | 479 | 0.71386 | 0 | 0 | 0 | 0 | 0 | 0 | 315 | 0.469449 |
45148079bc72efab4e9fdeacd43d659e9726c7f1 | 1,332 | py | Python | tests/pvsystemprofiler/test_equation_of_time.py | slacgismo/pv-system-profiler | 5ab663cd186511605bbb1e6aa387c8b897e47d83 | [
"BSD-2-Clause"
] | 4 | 2020-08-18T14:28:44.000Z | 2021-10-14T13:17:03.000Z | tests/pvsystemprofiler/test_equation_of_time.py | slacgismo/pv-system-profiler | 5ab663cd186511605bbb1e6aa387c8b897e47d83 | [
"BSD-2-Clause"
] | 10 | 2020-04-14T18:57:03.000Z | 2021-09-14T15:26:24.000Z | tests/pvsystemprofiler/test_equation_of_time.py | slacgismo/pv-system-profiler | 5ab663cd186511605bbb1e6aa387c8b897e47d83 | [
"BSD-2-Clause"
] | null | null | null | import unittest
import os
from pathlib import Path
import numpy as np
path = Path.cwd().parent.parent
os.chdir(path)
from pvsystemprofiler.utilities.equation_of_time import eot_da_rosa, eot_duffie
class TestEquationOfTime(unittest.TestCase):
# importing input for both eot tests
filepath = Path(__file__).pare... | 32.487805 | 101 | 0.722973 | 1,083 | 0.813063 | 0 | 0 | 0 | 0 | 0 | 0 | 180 | 0.135135 |
4514a6b0a130ee0e5e4417b6086e78904e058a13 | 1,942 | py | Python | raiden/tests/unit/transfer/test_node.py | gasparmedina/raiden | 649c43b7233b9e95f13831e61d5db187d583367a | [
"MIT"
] | null | null | null | raiden/tests/unit/transfer/test_node.py | gasparmedina/raiden | 649c43b7233b9e95f13831e61d5db187d583367a | [
"MIT"
] | null | null | null | raiden/tests/unit/transfer/test_node.py | gasparmedina/raiden | 649c43b7233b9e95f13831e61d5db187d583367a | [
"MIT"
] | 4 | 2019-01-24T14:45:06.000Z | 2019-04-01T16:12:40.000Z | from raiden.constants import EMPTY_MERKLE_ROOT
from raiden.tests.utils.factories import HOP1, HOP2, UNIT_SECRETHASH, make_block_hash
from raiden.transfer.events import ContractSendChannelBatchUnlock
from raiden.transfer.node import is_transaction_effect_satisfied
from raiden.transfer.state_change import ContractReceive... | 45.162791 | 91 | 0.785273 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 236 | 0.121524 |
451505779ddfa18b109340abfbe8b097a645a054 | 2,826 | py | Python | tfx/utils/channel_test.py | HassanDayoub/tfx | dc9221abbb8dad991d1ae22fb91876da1290efae | [
"Apache-2.0"
] | 2 | 2019-07-08T20:56:13.000Z | 2020-08-04T17:07:26.000Z | tfx/utils/channel_test.py | HassanDayoub/tfx | dc9221abbb8dad991d1ae22fb91876da1290efae | [
"Apache-2.0"
] | null | null | null | tfx/utils/channel_test.py | HassanDayoub/tfx | dc9221abbb8dad991d1ae22fb91876da1290efae | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC. 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... | 34.888889 | 74 | 0.754777 | 1,893 | 0.669851 | 0 | 0 | 0 | 0 | 0 | 0 | 875 | 0.309625 |
45154cfb764af63ed99ff0eaf6a51b8393aa6827 | 1,870 | py | Python | lyrics.py | samiraafreen/lyrics-generator | 37f894bdb8986c153985104af83e12ef8d6dac07 | [
"MIT"
] | null | null | null | lyrics.py | samiraafreen/lyrics-generator | 37f894bdb8986c153985104af83e12ef8d6dac07 | [
"MIT"
] | null | null | null | lyrics.py | samiraafreen/lyrics-generator | 37f894bdb8986c153985104af83e12ef8d6dac07 | [
"MIT"
] | null | null | null | import configparser
import requests
from bs4 import BeautifulSoup
def getAccessToken():
config = configparser.ConfigParser()
config.read('config.ini')
return config['Client_Access_Token']['token']
token = getAccessToken()
def searchMusicArtist(name):
api_url = "https://api.genius.com/search?q={}".for... | 28.333333 | 95 | 0.648128 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 477 | 0.25508 |