hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | 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 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 972 | max_forks_repo_name stringlengths 6 130 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
026d2e3c5400ba7779e80350198ab4ac1f1d1a70 | 1,712 | py | Python | lark/grammar.py | dsd/lark | 01cfe322a14f36228ff3dab0421d1f1108b321d7 | [
"MIT"
] | 1 | 2018-09-16T22:26:42.000Z | 2018-09-16T22:26:42.000Z | lark/grammar.py | dsd/lark | 01cfe322a14f36228ff3dab0421d1f1108b321d7 | [
"MIT"
] | null | null | null | lark/grammar.py | dsd/lark | 01cfe322a14f36228ff3dab0421d1f1108b321d7 | [
"MIT"
] | null | null | null | class Symbol(object):
is_term = NotImplemented
def __init__(self, name):
self.name = name
def __eq__(self, other):
assert isinstance(other, Symbol), other
return self.is_term == other.is_term and self.name == other.name
def __ne__(self, other):
return not (self == othe... | 25.552239 | 95 | 0.603972 |
5e040dd4aa9c94494a44573e13ea9b777fc1afa2 | 9,160 | py | Python | icekit/publishing/middleware.py | ic-labs/django-icekit | c507ea5b1864303732c53ad7c5800571fca5fa94 | [
"MIT"
] | 52 | 2016-09-13T03:50:58.000Z | 2022-02-23T16:25:08.000Z | icekit/publishing/middleware.py | ic-labs/django-icekit | c507ea5b1864303732c53ad7c5800571fca5fa94 | [
"MIT"
] | 304 | 2016-08-11T14:17:30.000Z | 2020-07-22T13:35:18.000Z | icekit/publishing/middleware.py | ic-labs/django-icekit | c507ea5b1864303732c53ad7c5800571fca5fa94 | [
"MIT"
] | 12 | 2016-09-21T18:46:35.000Z | 2021-02-15T19:37:50.000Z | import inspect
from contextlib import contextmanager
from threading import current_thread
from django.core.urlresolvers import Resolver404, resolve
from django.http import HttpResponseRedirect
from .utils import get_draft_url, verify_draft_url
class PublishingMiddleware(object):
"""
Publishing middleware to... | 36.494024 | 79 | 0.66714 |
03ed3d8fdbfa774bd5971ae8c67e876a00cd74ba | 1,431 | bzl | Python | ppx/_config/settings.bzl | layus/rules_ocaml | bbcc7bfe3787038b2207e07a1e795fcab32dc676 | [
"Apache-2.0"
] | 14 | 2020-12-05T15:00:37.000Z | 2022-01-03T23:41:51.000Z | ppx/_config/settings.bzl | layus/rules_ocaml | bbcc7bfe3787038b2207e07a1e795fcab32dc676 | [
"Apache-2.0"
] | 43 | 2021-01-04T13:17:14.000Z | 2021-11-22T14:26:50.000Z | ppx/_config/settings.bzl | layus/rules_ocaml | bbcc7bfe3787038b2207e07a1e795fcab32dc676 | [
"Apache-2.0"
] | 4 | 2021-05-31T14:28:13.000Z | 2021-11-19T09:13:55.000Z | load("//ocaml:providers.bzl",
"PpxCompilationModeSettingProvider",
"PpxPrintSettingProvider"
)
################################################################
def _ppx_compilation_mode_impl(ctx):
if ctx.build_setting_value not in ["native", "bytecode"]:
fail("Bad value for @ppx//print. Allo... | 34.902439 | 77 | 0.662474 |
c5644414ad2ba78c87021c7cd6e1171be2e34066 | 1,671 | py | Python | restbot/services/models.py | cwerner/restbot | ad5546e3b60dba395adbca4e2c51d29b12565a24 | [
"Apache-2.0"
] | null | null | null | restbot/services/models.py | cwerner/restbot | ad5546e3b60dba395adbca4e2c51d29b12565a24 | [
"Apache-2.0"
] | null | null | null | restbot/services/models.py | cwerner/restbot | ad5546e3b60dba395adbca4e2c51d29b12565a24 | [
"Apache-2.0"
] | null | null | null |
from typing import List
import joblib
import numpy as np
from loguru import logger
from restbot.core.messages import NO_VALID_PAYLOAD
from restbot.models.payload import (HousePredictionPayload,
payload_to_list)
from restbot.models.prediction import HousePredictionResult
... | 31.528302 | 77 | 0.699581 |
1b778666357ce0b8612c9290fe833b04a053104e | 2,225 | py | Python | my_objects.py | jeffakolb/Gnip-Filter-Optimization | 23d15aadcd26cd316acc3c5d456000cb855ef050 | [
"MIT"
] | 1 | 2021-01-13T22:31:00.000Z | 2021-01-13T22:31:00.000Z | my_objects.py | jeffakolb/Gnip-Filter-Optimization | 23d15aadcd26cd316acc3c5d456000cb855ef050 | [
"MIT"
] | null | null | null | my_objects.py | jeffakolb/Gnip-Filter-Optimization | 23d15aadcd26cd316acc3c5d456000cb855ef050 | [
"MIT"
] | 1 | 2019-12-17T18:26:01.000Z | 2019-12-17T18:26:01.000Z | import json
search_configs = [
{
'name':'test_run',
'rule':'apple lang:en',
'start':'2016-07-25T00:00',
'end':'2016-07-26T00:00',
'max_tweets':1000
}
]
labeling_config = {
'label_fraction':0.1, # score this fraction of the twee... | 35.31746 | 111 | 0.587416 |
932a36014760f07ccf40faa2298706e84a99a112 | 11,159 | py | Python | src/webdriver/appengine_communicator.py | ka2th1k/qualitybots | 391e2419c0886463e2a7c3d46a35523f95ce9672 | [
"Apache-2.0"
] | 4 | 2015-10-20T13:38:12.000Z | 2021-04-28T02:02:02.000Z | src/webdriver/appengine_communicator.py | ka2th1k/qualitybots | 391e2419c0886463e2a7c3d46a35523f95ce9672 | [
"Apache-2.0"
] | null | null | null | src/webdriver/appengine_communicator.py | ka2th1k/qualitybots | 391e2419c0886463e2a7c3d46a35523f95ce9672 | [
"Apache-2.0"
] | 2 | 2016-04-02T16:53:26.000Z | 2016-09-10T02:46:30.000Z | #!/usr/bin/python2.6
#
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | 34.441358 | 80 | 0.698987 |
b9cb9baec3886d7556f2b57b909e95067841c8cc | 630 | py | Python | visualizer/migrations/0003_video.py | FuckBrains/Artilizer | dd7a66a7e0a2c9cf260e11fc5e4ec7d50cd51d9e | [
"Apache-2.0"
] | 4 | 2019-09-21T16:02:39.000Z | 2020-09-08T00:56:40.000Z | visualizer/migrations/0003_video.py | FuckBrains/Artilizer | dd7a66a7e0a2c9cf260e11fc5e4ec7d50cd51d9e | [
"Apache-2.0"
] | 11 | 2019-09-22T16:50:45.000Z | 2021-06-09T18:40:31.000Z | visualizer/migrations/0003_video.py | betafactory/Artilizer | dd7a66a7e0a2c9cf260e11fc5e4ec7d50cd51d9e | [
"Apache-2.0"
] | 5 | 2019-09-21T15:46:47.000Z | 2021-05-26T19:30:29.000Z | # Generated by Django 2.2.6 on 2019-10-05 16:57
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('visualizer', '0002_delete_video'),
]
operations = [
migrations.CreateModel(
name='Video',
fields... | 26.25 | 114 | 0.580952 |
f68da3c9c0a3e8c104c654cdb3d0c0075872dd09 | 5,756 | py | Python | userbot/plugins/pmpermit_menu.py | saskeuday/masterSaske | 5f4db35c718f85a4d68b86bd2c1c6221e4b6d319 | [
"MIT"
] | null | null | null | userbot/plugins/pmpermit_menu.py | saskeuday/masterSaske | 5f4db35c718f85a4d68b86bd2c1c6221e4b6d319 | [
"MIT"
] | null | null | null | userbot/plugins/pmpermit_menu.py | saskeuday/masterSaske | 5f4db35c718f85a4d68b86bd2c1c6221e4b6d319 | [
"MIT"
] | null | null | null | # if you change credits, you get anal cancer and get murdered by russians in 3 days.
"""
Support chatbox for pmpermit.
Used by incoming messages with trigger as start
Will not work for already approved people.
"""
import asyncio
import io
import telethon.sync
from telethon.tl.functions.users import GetFullUserRequest
... | 52.327273 | 405 | 0.561501 |
3624202ecec1fd3d6e353a52a5b9ba5a4f0823c3 | 1,536 | py | Python | frappe/integrations/oauth2_logins.py | farhan2222/frappe | 7d06f9ce503e108239073a5c71ad1d9f7df24850 | [
"MIT"
] | null | null | null | frappe/integrations/oauth2_logins.py | farhan2222/frappe | 7d06f9ce503e108239073a5c71ad1d9f7df24850 | [
"MIT"
] | null | null | null | frappe/integrations/oauth2_logins.py | farhan2222/frappe | 7d06f9ce503e108239073a5c71ad1d9f7df24850 | [
"MIT"
] | 3 | 2019-01-11T21:34:52.000Z | 2020-03-18T07:53:09.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import frappe.utils
from frappe.utils.oauth import login_via_oauth2, login_via_oauth2_id_token
import json
@frappe.whitelist(allow_guest=True)
def login_via_google(... | 32.680851 | 76 | 0.782552 |
f13099436d816f5c176d0e9d32022ce40d8dd97e | 3,622 | py | Python | reid/models/end2end.py | Proxim123/one-person-re-id | 829fb585a10cb4948a70ee53aeca348b8ed4aa8c | [
"MIT"
] | 127 | 2019-01-11T04:33:42.000Z | 2021-09-07T09:43:22.000Z | reid/models/end2end.py | ChronousZhang/One-Example-Person-ReID | 43938c1bc9527f2dbddf35748efc05e6fcf10d51 | [
"MIT"
] | 15 | 2019-01-26T05:39:23.000Z | 2020-12-04T01:17:39.000Z | reid/models/end2end.py | ChronousZhang/One-Example-Person-ReID | 43938c1bc9527f2dbddf35748efc05e6fcf10d51 | [
"MIT"
] | 30 | 2019-01-11T07:46:25.000Z | 2022-02-05T05:58:17.000Z | from __future__ import absolute_import
from torch import nn
from torch.autograd import Variable
from torch.nn import functional as F
from torch.nn import init
import torch
import torchvision
import math
from .resnet import *
__all__ = ["End2End_AvgPooling"]
class AvgPooling(nn.Module):
def __init__(self, inpu... | 32.339286 | 164 | 0.653506 |
46b18c0e935fd77b7c9a98458728f8d41ea07c6a | 3,016 | py | Python | examples/exp_configs/non_rl/highway_single.py | lcipolina/flow | e2251d57d930b251896845a65fcb109f1c1f4087 | [
"MIT"
] | 1 | 2020-03-25T00:03:06.000Z | 2020-03-25T00:03:06.000Z | examples/exp_configs/non_rl/highway_single.py | DevPyer/flow | 50be2d074027fb465fc4a9103b3cc09fb1123ede | [
"MIT"
] | 1 | 2020-03-16T21:43:07.000Z | 2020-03-16T21:43:07.000Z | examples/exp_configs/non_rl/highway_single.py | lcipolina/flow | e2251d57d930b251896845a65fcb109f1c1f4087 | [
"MIT"
] | null | null | null | """Multi-agent highway with ramps example.
Trains a non-constant number of agents, all sharing the same policy, on the
highway with ramps network.
"""
from flow.controllers import BandoFTLController
from flow.core.params import EnvParams
from flow.core.params import NetParams
from flow.core.params import InitialConfig... | 27.171171 | 77 | 0.705902 |
c38e4a3250bc740136403e69de428ae69f721166 | 13,538 | py | Python | simple_cvrp.py | PedroBCSilva/unisinos-ia-tga | 48cfe7c9a1a1171b231c1bcaa69365a56c2e220f | [
"MIT"
] | null | null | null | simple_cvrp.py | PedroBCSilva/unisinos-ia-tga | 48cfe7c9a1a1171b231c1bcaa69365a56c2e220f | [
"MIT"
] | 2 | 2019-04-22T00:05:16.000Z | 2019-04-22T00:05:22.000Z | simple_cvrp.py | PedroBCSilva/unisinos-ia-tga | 48cfe7c9a1a1171b231c1bcaa69365a56c2e220f | [
"MIT"
] | null | null | null | # COMO USAR python simple_cvrp.py --file "CVRP/test.txt"
import random, sys, copy, math
from optparse import OptionParser
from random import randint
class cvrp:
def __init__(self, filename, truck_count, repetitions):
self.filename = filename
self.nodes = []
self.nodes_count = 0
sel... | 44.09772 | 269 | 0.546462 |
af74dcf11bf85c03d8f850990d060d38d1fef04f | 15,226 | py | Python | compare_lrs.py | TorHou/ContigAnalysisScripts | 7cd240babf6c8889a25604d3cfb262e241fcfa11 | [
"MIT"
] | 1 | 2018-07-27T00:54:35.000Z | 2018-07-27T00:54:35.000Z | compare_lrs.py | DiltheyLab/ContigAnalysisScripts | 7cd240babf6c8889a25604d3cfb262e241fcfa11 | [
"MIT"
] | null | null | null | compare_lrs.py | DiltheyLab/ContigAnalysisScripts | 7cd240babf6c8889a25604d3cfb262e241fcfa11 | [
"MIT"
] | null | null | null | from argparse import ArgumentParser
from Bio import SeqIO
import sys
import pickle
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib.backends.backend_pdf import PdfPages
import numpy as np
from random import sample
import logging
from logging import info
from itertools impor... | 35.491841 | 160 | 0.530211 |
340e6dcf9bcc38789dbf784618dc000bed60cf27 | 1,639 | py | Python | scaffold/identical_murcko_scaffold.py | fujirock/Reinvent | 9c57636f9d32b4ce5b75670f43906a70d5daf886 | [
"MIT"
] | 4 | 2021-05-11T05:34:01.000Z | 2022-03-30T10:04:21.000Z | scaffold/identical_murcko_scaffold.py | prasannavd/Reinvent | ca02ebee8d8ed83223c55f4a1dd1b3fbc2359616 | [
"MIT"
] | null | null | null | scaffold/identical_murcko_scaffold.py | prasannavd/Reinvent | ca02ebee8d8ed83223c55f4a1dd1b3fbc2359616 | [
"MIT"
] | 2 | 2021-06-01T11:56:10.000Z | 2021-10-05T04:33:56.000Z | from copy import deepcopy
import numpy as np
from rdkit import Chem
from rdkit.Chem.Scaffolds import MurckoScaffold
from scaffold.scaffold_filters import ScaffoldFilter
from scaffold.scaffold_parameters import ScaffoldParameters
from scoring.score_summary import FinalSummary
from utils.smiles import convert_to_rdkit_... | 37.25 | 94 | 0.691275 |
6c34ce41129b84d2fb74ad9412435dde9de07454 | 5,639 | py | Python | pexpect/replwrap.py | dolfinus/pexpect | 3453ea9b8b326179cf720351001e64c7ea6b07bc | [
"0BSD"
] | 2,132 | 2015-01-02T12:48:45.000Z | 2022-03-28T05:32:54.000Z | pexpect/replwrap.py | dolfinus/pexpect | 3453ea9b8b326179cf720351001e64c7ea6b07bc | [
"0BSD"
] | 536 | 2015-01-02T19:42:34.000Z | 2022-03-10T16:40:35.000Z | pexpect/replwrap.py | dolfinus/pexpect | 3453ea9b8b326179cf720351001e64c7ea6b07bc | [
"0BSD"
] | 517 | 2015-01-07T02:09:44.000Z | 2022-03-26T14:18:23.000Z | """Generic wrapper for read-eval-print-loops, a.k.a. interactive shells
"""
import os.path
import signal
import sys
import pexpect
PY3 = (sys.version_info[0] >= 3)
if PY3:
basestring = str
PEXPECT_PROMPT = u'[PEXPECT_PROMPT>'
PEXPECT_CONTINUATION_PROMPT = u'[PEXPECT_PROMPT+'
class REPLWrapper(object):
"""W... | 43.045802 | 87 | 0.648342 |
1f8b6e5d36067a82d06886edfbb99fc6684c114f | 1,057 | py | Python | tests/common/plugins/sanity_check/constants.py | dipalipatel25/sonic-mgmt | 54f52b689e817aa9ad6955643f9271dc40fcfc02 | [
"Apache-2.0"
] | null | null | null | tests/common/plugins/sanity_check/constants.py | dipalipatel25/sonic-mgmt | 54f52b689e817aa9ad6955643f9271dc40fcfc02 | [
"Apache-2.0"
] | null | null | null | tests/common/plugins/sanity_check/constants.py | dipalipatel25/sonic-mgmt | 54f52b689e817aa9ad6955643f9271dc40fcfc02 | [
"Apache-2.0"
] | null | null | null |
PRINT_LOGS = {
"version": "show version",
"images": "sonic_installer list",
"docker": "docker ps -a",
"interfaces": "show interface status",
"ip": "show ip interface",
"neigh": "ip neigh",
"bgp": "show bgp summary",
"routes": "ip route | wc -l"
}
# Recover related definitions
RECOVER_M... | 44.041667 | 114 | 0.624409 |
fa3af6261181f79fe0dcec5e7a150c2de8dbef25 | 1,756 | py | Python | MiniTourn_Triple/Player.py | jeffreyzli/pokerbot-2017 | df2aa31d6aaf0e3162d24ae5f4c2a918ab19831f | [
"MIT"
] | 1 | 2017-01-18T21:25:21.000Z | 2017-01-18T21:25:21.000Z | BetFoldBot/Player.py | jeffreyzli/pokerbot-2017 | df2aa31d6aaf0e3162d24ae5f4c2a918ab19831f | [
"MIT"
] | null | null | null | BetFoldBot/Player.py | jeffreyzli/pokerbot-2017 | df2aa31d6aaf0e3162d24ae5f4c2a918ab19831f | [
"MIT"
] | 3 | 2017-02-06T04:35:02.000Z | 2020-03-08T18:56:25.000Z | import argparse
import socket
import sys
from GameData import GameData
import BetFoldLogic as BetFold
class Player:
def run(self, input_socket):
f_in = input_socket.makefile()
while True:
data = f_in.readline().strip()
if not data:
print "Gameover, engin... | 30.275862 | 123 | 0.585991 |
25e2c4e0066ee8c549f175ff5c6a856ea47779ca | 16,730 | py | Python | neutronclient/neutron/v2_0/providernet.py | teresa-ho/stx-python-neutronclient | 35ea6c2c96cbf98755a82cb7c19138648552b778 | [
"Apache-2.0"
] | null | null | null | neutronclient/neutron/v2_0/providernet.py | teresa-ho/stx-python-neutronclient | 35ea6c2c96cbf98755a82cb7c19138648552b778 | [
"Apache-2.0"
] | 2 | 2018-11-01T21:50:21.000Z | 2018-11-13T21:40:09.000Z | neutronclient/neutron/v2_0/providernet.py | teresa-ho/stx-python-neutronclient | 35ea6c2c96cbf98755a82cb7c19138648552b778 | [
"Apache-2.0"
] | 3 | 2018-11-01T17:55:23.000Z | 2018-11-23T19:16:06.000Z | # Copyright 2014 OpenStack 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... | 36.448802 | 79 | 0.608488 |
312060022c3cebf40a1611edb1ce897c2e7827c1 | 1,849 | py | Python | interpret/attr/gradcam.py | ttumiel/interpret | aeecb00bf65376668a48895cb707beb6dd8fb7ab | [
"MIT"
] | 14 | 2019-10-28T18:49:31.000Z | 2021-03-25T12:13:35.000Z | interpret/attr/gradcam.py | ttumiel/interpret | aeecb00bf65376668a48895cb707beb6dd8fb7ab | [
"MIT"
] | null | null | null | interpret/attr/gradcam.py | ttumiel/interpret | aeecb00bf65376668a48895cb707beb6dd8fb7ab | [
"MIT"
] | null | null | null | import torch.nn.functional as F
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
from interpret.hooks import *
from interpret import core
from interpret.utils import denorm
from interpret.attr import Attribute
class Gradcam(Attribute):
"""Generates a Grad-CAM attribution map for convolutio... | 37.734694 | 84 | 0.623039 |
902b33157b66a69cb01cc2b62cda9c9381021fe3 | 4,971 | py | Python | src/adcpyproc/misc_functions.py | oyvlun/adcpyproc | 1d2dd81c1295bb460a32badd5565976869a6e0b9 | [
"MIT"
] | null | null | null | src/adcpyproc/misc_functions.py | oyvlun/adcpyproc | 1d2dd81c1295bb460a32badd5565976869a6e0b9 | [
"MIT"
] | null | null | null | src/adcpyproc/misc_functions.py | oyvlun/adcpyproc | 1d2dd81c1295bb460a32badd5565976869a6e0b9 | [
"MIT"
] | null | null | null | #######################################################################
# MISC_FUNCTIONS
#######################################################################
'''
Various functions that are not specific to the classes defined in
adcpyproc:
- Find magnetic declination from lon/lat/time using geomag.
- Convert mpl tim... | 33.587838 | 79 | 0.576544 |
8be4ea792ed87a528997915de0ab58118373f91f | 71 | py | Python | dice_ml/__init__.py | prabhathur/CF | 20943f3f326e72ea7c5464bc2c3eee06703ed404 | [
"MIT"
] | 2 | 2021-05-19T04:29:06.000Z | 2021-07-22T17:25:08.000Z | dice_ml/__init__.py | prabhathur/CF | 20943f3f326e72ea7c5464bc2c3eee06703ed404 | [
"MIT"
] | null | null | null | dice_ml/__init__.py | prabhathur/CF | 20943f3f326e72ea7c5464bc2c3eee06703ed404 | [
"MIT"
] | 3 | 2019-11-24T01:06:24.000Z | 2020-11-24T14:04:09.000Z | from .data import Data
from .model import Model
from .dice import Dice
| 17.75 | 24 | 0.788732 |
3693a8820783a6f7cd7b934dcf1b27e5a6df3474 | 4,997 | py | Python | Python/getsubinterfaces.py | krapsusa/netmri-toolkit | 5740cd90e2fe242b8af3ec6192fca10a30cfa94d | [
"MIT"
] | 17 | 2015-09-17T18:25:55.000Z | 2020-08-27T00:16:54.000Z | Python/getsubinterfaces.py | krapsusa/netmri-toolkit | 5740cd90e2fe242b8af3ec6192fca10a30cfa94d | [
"MIT"
] | 2 | 2019-08-08T17:33:32.000Z | 2019-10-10T15:36:55.000Z | Python/getsubinterfaces.py | krapsusa/netmri-toolkit | 5740cd90e2fe242b8af3ec6192fca10a30cfa94d | [
"MIT"
] | 19 | 2016-04-25T12:45:31.000Z | 2020-09-28T18:24:51.000Z | #Device subinterface data retrieval script. Copyright Ingmar Van Glabbeek ingmar@infoblox.com
#Licensed under Apache-2.0
#This script will pull all devices of a given device group and then list the devices management ip as well as the available management ips.
#By default it saves the output to "deviceinterfacedump.js... | 34.462069 | 171 | 0.654993 |
84170e4c09ccb81a0cc041807fe28d01807cafe3 | 839 | py | Python | corehq/apps/userreports/tests/__init__.py | johan--/commcare-hq | 86ee99c54f55ee94e4c8f2f6f30fc44e10e69ebd | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/userreports/tests/__init__.py | johan--/commcare-hq | 86ee99c54f55ee94e4c8f2f6f30fc44e10e69ebd | [
"BSD-3-Clause"
] | 1 | 2022-03-12T01:03:25.000Z | 2022-03-12T01:03:25.000Z | corehq/apps/userreports/tests/__init__.py | johan--/commcare-hq | 86ee99c54f55ee94e4c8f2f6f30fc44e10e69ebd | [
"BSD-3-Clause"
] | null | null | null | from .test_app_manager_integration import *
from .test_columns import *
from .test_static_data_sources import *
from .test_static_reports import *
from .test_export import *
from .test_expressions import *
from .test_filters import *
from .test_getters import *
from .test_data_source_config import *
from .test_data_sou... | 28.931034 | 72 | 0.811681 |
24538d5f8b3f69b99cfa68bd089e7cf1c803e6c3 | 12,801 | py | Python | research/learned_optimizer/optimizer/coordinatewise_rnn.py | SimiaCryptus/models | c652a23a650070b71e286f1ded93726670161940 | [
"Apache-2.0"
] | null | null | null | research/learned_optimizer/optimizer/coordinatewise_rnn.py | SimiaCryptus/models | c652a23a650070b71e286f1ded93726670161940 | [
"Apache-2.0"
] | null | null | null | research/learned_optimizer/optimizer/coordinatewise_rnn.py | SimiaCryptus/models | c652a23a650070b71e286f1ded93726670161940 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Google, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 40.638095 | 80 | 0.650965 |
5e6599c413e9b6f159b74971339a93e99ad57029 | 2,147 | py | Python | python/hsfs/core/training_dataset_job_conf.py | kouzant/feature-store-api | f6a666e11fd33ae814a79c588ff49547b942b09d | [
"Apache-2.0"
] | 49 | 2020-09-07T17:43:11.000Z | 2021-12-28T10:41:03.000Z | python/hsfs/core/training_dataset_job_conf.py | kouzant/feature-store-api | f6a666e11fd33ae814a79c588ff49547b942b09d | [
"Apache-2.0"
] | 132 | 2020-08-06T12:12:09.000Z | 2022-03-29T16:28:25.000Z | python/hsfs/core/training_dataset_job_conf.py | isabella232/feature-store-api | 6f90c6039519422114c35ed47e1ea8765134e7ba | [
"Apache-2.0"
] | 35 | 2020-08-06T12:09:02.000Z | 2022-01-10T08:50:45.000Z | #
# Copyright 2021 Logical Clocks AB
#
# 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... | 29.013514 | 81 | 0.676758 |
27a6ccee90e7a814126f9a3a2cd8ac3505535718 | 5,764 | py | Python | vmtkScripts/vmtksurfaceviewer.py | haehn/vmtk | e8e2ee9f9bea6a1839a75b57caf82f6a86944db0 | [
"Apache-2.0"
] | 1 | 2017-02-23T09:31:53.000Z | 2017-02-23T09:31:53.000Z | vmtkScripts/vmtksurfaceviewer.py | haehn/vmtk | e8e2ee9f9bea6a1839a75b57caf82f6a86944db0 | [
"Apache-2.0"
] | null | null | null | vmtkScripts/vmtksurfaceviewer.py | haehn/vmtk | e8e2ee9f9bea6a1839a75b57caf82f6a86944db0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
## Program: VMTK
## Module: $RCSfile: vmtksurfaceviewer.py,v $
## Language: Python
## Date: $Date: 2006/05/26 12:35:13 $
## Version: $Revision: 1.10 $
## Copyright (c) Luca Antiga, David Steinman. All rights reserved.
## See LICENCE file for details.
## This software is di... | 39.751724 | 110 | 0.598543 |
2933852f97cfef69a895b382d81d8dbc1e584678 | 2,415 | py | Python | mlir/test/python/dialects/linalg/opdsl/shape_maps_iteration.py | jessicadavies-intel/llvm | 4236bbba4c562a1355e75fa6d237b7c6b15a3193 | [
"Apache-2.0"
] | 1 | 2022-01-06T15:44:48.000Z | 2022-01-06T15:44:48.000Z | mlir/test/python/dialects/linalg/opdsl/shape_maps_iteration.py | jessicadavies-intel/llvm | 4236bbba4c562a1355e75fa6d237b7c6b15a3193 | [
"Apache-2.0"
] | 2 | 2019-06-27T00:36:28.000Z | 2021-06-29T20:05:03.000Z | mlir/test/python/dialects/linalg/opdsl/shape_maps_iteration.py | kbobrovs/llvm | b57c6bf3b16e6d3f6c052ba9ba3616a24e0beae5 | [
"Apache-2.0"
] | null | null | null | # RUN: %PYTHON -m mlir.dialects.linalg.opdsl.dump_oplib --file %s | FileCheck %s
from mlir.dialects.linalg.opdsl.lang import *
# Verify that simple case with iteration order defined lexically and reduction
# dims auto discovered emits the right shape, indexing maps and iterator types.
# CHECK: ---
# CHECK-LABEL: mat... | 37.153846 | 80 | 0.630642 |
6326c6ad6801538348c90de4982669759fe02d41 | 5,475 | py | Python | packages/python/plotly/plotly/graph_objs/layout/ternary/caxis/_title.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/graph_objs/layout/ternary/caxis/_title.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/graph_objs/layout/ternary/caxis/_title.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Title(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout.ternary.caxis"
_path_str = "layout.ternary.caxis.title"
_valid_props = {"font", "te... | 32.589286 | 85 | 0.538995 |
d4f7fe4604e9a8f4833ee57085eae49a0decf90a | 16,788 | py | Python | wstools/c14n.py | Neurones67/wstools-py3 | ce2c368db7d197664165497d83206dd8d3952659 | [
"BSD-3-Clause"
] | null | null | null | wstools/c14n.py | Neurones67/wstools-py3 | ce2c368db7d197664165497d83206dd8d3952659 | [
"BSD-3-Clause"
] | 1 | 2018-04-25T09:08:14.000Z | 2018-04-25T09:08:14.000Z | wstools/c14n.py | Neurones67/wstools-py3 | ce2c368db7d197664165497d83206dd8d3952659 | [
"BSD-3-Clause"
] | 2 | 2018-04-25T06:29:30.000Z | 2022-03-09T11:27:49.000Z | #! /usr/bin/env python
import string
import sys
from xml.dom import Node
try:
from xml.ns import XMLNS
except ImportError:
class XMLNS(object):
BASE = "http://www.w3.org/2000/xmlns/"
XML = "http://www.w3.org/XML/1998/namespace"
try:
from io import StringIO
except ImportError:
from io im... | 34.472279 | 109 | 0.585835 |
80c9c7aec75883c5ed38b5d882ac3ac433bfb5cf | 2,703 | py | Python | question_generation/selection.py | willywsm1013/transformers-for-question-generation | 16f6fd48e61e1f0ce9ce54b7d9d3f01260257082 | [
"Apache-2.0"
] | 2 | 2022-02-17T09:43:05.000Z | 2022-02-20T11:14:15.000Z | question_generation/selection.py | willywsm1013/transformers-for-question-generation | 16f6fd48e61e1f0ce9ce54b7d9d3f01260257082 | [
"Apache-2.0"
] | 9 | 2020-11-13T17:51:46.000Z | 2022-03-12T00:46:15.000Z | question_generation/selection.py | willywsm1013/transformers-for-question-generation | 16f6fd48e61e1f0ce9ce54b7d9d3f01260257082 | [
"Apache-2.0"
] | 1 | 2021-02-12T16:31:47.000Z | 2021-02-12T16:31:47.000Z | import json
import os
import sys
import re
import numpy as np
from nltk.tokenize import TreebankWordTokenizer
nltk_tokenizer = TreebankWordTokenizer()
def process(text):
toks = nltk_tokenizer.tokenize(text)
return ' '.join([tok.replace("''", '"').replace("``", '"') for tok in toks]).lower()
def get_log_a_prob... | 31.430233 | 159 | 0.63189 |
b7e8281bceb256b493dbdd82b795c7f8d37ba37a | 8,381 | py | Python | Lib/fontTools/ttLib/tables/G__l_a_t.py | twardoch/fonttools-py27 | 75b852d3f59fc0d03c6e78581530597d4c6368a1 | [
"MIT",
"BSD-3-Clause"
] | 240 | 2021-01-11T14:49:24.000Z | 2022-03-29T22:33:49.000Z | Lib/fontTools/ttLib/tables/G__l_a_t.py | twardoch/fonttools-py27 | 75b852d3f59fc0d03c6e78581530597d4c6368a1 | [
"MIT",
"BSD-3-Clause"
] | 77 | 2021-01-12T20:23:30.000Z | 2022-03-28T12:14:34.000Z | Lib/fontTools/ttLib/tables/G__l_a_t.py | twardoch/fonttools-py27 | 75b852d3f59fc0d03c6e78581530597d4c6368a1 | [
"MIT",
"BSD-3-Clause"
] | 28 | 2021-01-17T05:44:11.000Z | 2022-01-11T19:58:46.000Z | from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
from fontTools.misc import sstruct
from fontTools.misc.textTools import safeEval
from itertools import *
from functools import partial
from . import DefaultTable
from . import grUtils
import struct, operator, warnings
G... | 38.269406 | 93 | 0.553275 |
1ea0a4b5c4a439fb871618fbe7526e7b231296d3 | 2,529 | py | Python | crypto_wallet.py | ChrisKwiat84/Cryptocurrency-Wallet-2.19.22 | 1b9f6b234006c5e1e2cf25d4748ece6b0c55a590 | [
"ADSL"
] | null | null | null | crypto_wallet.py | ChrisKwiat84/Cryptocurrency-Wallet-2.19.22 | 1b9f6b234006c5e1e2cf25d4748ece6b0c55a590 | [
"ADSL"
] | null | null | null | crypto_wallet.py | ChrisKwiat84/Cryptocurrency-Wallet-2.19.22 | 1b9f6b234006c5e1e2cf25d4748ece6b0c55a590 | [
"ADSL"
] | null | null | null | # Cryptocurrency Wallet
################################################################################
# This file contains the Ethereum transaction functions that you have created throughout this module’s lessons. By using import statements, you will integrate this `crypto_wallet.py` Python script into the Fintech ... | 33.276316 | 285 | 0.652432 |
b0cdf334cfa1279c668f161c74a6cb34a5ee352d | 10,121 | py | Python | homeassistant/components/switch/rainmachine.py | don66/home-assistant | a277470363c0758bb305410aad49c257ff8bac40 | [
"Apache-2.0"
] | 7 | 2018-08-03T10:15:36.000Z | 2019-03-25T13:31:55.000Z | homeassistant/components/switch/rainmachine.py | sara0871/https-wakatime.com-android-studio | 5a15b2c036b332c17d5f6a06664378e9273d684f | [
"Apache-2.0"
] | 3 | 2021-09-08T03:06:43.000Z | 2022-03-12T00:56:04.000Z | homeassistant/components/switch/rainmachine.py | sara0871/https-wakatime.com-android-studio | 5a15b2c036b332c17d5f6a06664378e9273d684f | [
"Apache-2.0"
] | 3 | 2018-10-09T08:37:48.000Z | 2019-11-16T08:32:27.000Z | """
This component provides support for RainMachine programs and zones.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/switch.rainmachine/
"""
import logging
from homeassistant.components.rainmachine import (
CONF_ZONE_RUN_TIME, DATA_RAINMACHINE, D... | 31.141538 | 79 | 0.612094 |
8661752f8a16f4ba32091b9b7f130e341280cb8d | 243 | py | Python | App/apis/__init__.py | jonathan-hxj/FlaskTpp | 0d24f432ab9321fd5d260f80183aec252e1cac35 | [
"MIT"
] | null | null | null | App/apis/__init__.py | jonathan-hxj/FlaskTpp | 0d24f432ab9321fd5d260f80183aec252e1cac35 | [
"MIT"
] | null | null | null | App/apis/__init__.py | jonathan-hxj/FlaskTpp | 0d24f432ab9321fd5d260f80183aec252e1cac35 | [
"MIT"
] | null | null | null | from App.apis.admin import admin_api
from App.apis.movie_admin import movie_client_api
from App.apis.movie_user import client_api
def init_api(app):
admin_api.init_app(app)
movie_client_api.init_app(app)
client_api.init_app(app)
| 24.3 | 49 | 0.798354 |
edbae480f12aa72f0e56ba4902ac3db8a9592922 | 5,285 | py | Python | mw4/test/test_units/gui/mainWmixin/test_tabSettHorizon.py | Raddock/MountWizzard4 | 15efed77c1634461184e90a7cf6419eec0dec909 | [
"Apache-2.0"
] | null | null | null | mw4/test/test_units/gui/mainWmixin/test_tabSettHorizon.py | Raddock/MountWizzard4 | 15efed77c1634461184e90a7cf6419eec0dec909 | [
"Apache-2.0"
] | null | null | null | mw4/test/test_units/gui/mainWmixin/test_tabSettHorizon.py | Raddock/MountWizzard4 | 15efed77c1634461184e90a7cf6419eec0dec909 | [
"Apache-2.0"
] | null | null | null | ############################################################
# -*- coding: utf-8 -*-
#
# # # # # # #
# ## ## # ## # #
# # # # # # # # # # #
# # ## # ## ## ######
# # # # # # #
#
# Python-based Tool for interaction with the 10micron mounts
# GUI with PyQT5 fo... | 32.826087 | 81 | 0.519962 |
db2456e013eaa95c64b25c37289b3f3fc66f70b5 | 897 | py | Python | software/pynguin/pynguin/__init__.py | se2p/artifact-pynguin-ssbse2020 | 32b5f4d27ef1b81e5c541471e98fa6e50f5ce8a6 | [
"CC-BY-4.0"
] | 3 | 2020-08-20T10:27:13.000Z | 2021-11-02T20:28:16.000Z | software/pynguin/pynguin/__init__.py | se2p/artifact-pynguin-ssbse2020 | 32b5f4d27ef1b81e5c541471e98fa6e50f5ce8a6 | [
"CC-BY-4.0"
] | null | null | null | software/pynguin/pynguin/__init__.py | se2p/artifact-pynguin-ssbse2020 | 32b5f4d27ef1b81e5c541471e98fa6e50f5ce8a6 | [
"CC-BY-4.0"
] | null | null | null | # This file is part of Pynguin.
#
# Pynguin is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pynguin is distributed in the ho... | 42.714286 | 77 | 0.764771 |
01925ffb4478380d23178cedeee096c7d2836912 | 12,640 | py | Python | supervised/ensemble.py | TaniaSaleem14/mljar-supervised | b45801cdd904fd31d863b9b893352e71e2fe10d8 | [
"MIT"
] | null | null | null | supervised/ensemble.py | TaniaSaleem14/mljar-supervised | b45801cdd904fd31d863b9b893352e71e2fe10d8 | [
"MIT"
] | null | null | null | supervised/ensemble.py | TaniaSaleem14/mljar-supervised | b45801cdd904fd31d863b9b893352e71e2fe10d8 | [
"MIT"
] | null | null | null | import os
import logging
import copy
import numpy as np
import pandas as pd
import time
import uuid
import json
import operator
from supervised.utils.config import storage_path
from supervised.algorithms.algorithm import BaseAlgorithm
from supervised.algorithms.registry import BINARY_CLASSIFICATION
from supervised.alg... | 37.286136 | 105 | 0.609256 |
fc2900b93ff1ccdce6d80e22cbcbea42fe6bf90e | 4,224 | py | Python | drive.py | ahtchow/CarND-BehaviouralCloning-P3 | 5dc41cd5080f95e0c8caacb24eb3e65b54c01494 | [
"MIT"
] | null | null | null | drive.py | ahtchow/CarND-BehaviouralCloning-P3 | 5dc41cd5080f95e0c8caacb24eb3e65b54c01494 | [
"MIT"
] | null | null | null | drive.py | ahtchow/CarND-BehaviouralCloning-P3 | 5dc41cd5080f95e0c8caacb24eb3e65b54c01494 | [
"MIT"
] | null | null | null | import argparse
import base64
from datetime import datetime
import os
import shutil
import numpy as np
import cv2
import socketio
import eventlet
import eventlet.wsgi
from PIL import Image
from flask import Flask
from io import BytesIO
from keras.models import load_model
import h5py
from keras import __version__ as k... | 27.97351 | 89 | 0.631392 |
909ba0c787abf8a896af084a044c7f6041ed28c7 | 1,398 | py | Python | what_apps/push/functions.py | SlashRoot/WHAT | 69e78d01065142446234e77ea7c8c31e3482af29 | [
"MIT"
] | null | null | null | what_apps/push/functions.py | SlashRoot/WHAT | 69e78d01065142446234e77ea7c8c31e3482af29 | [
"MIT"
] | null | null | null | what_apps/push/functions.py | SlashRoot/WHAT | 69e78d01065142446234e77ea7c8c31e3482af29 | [
"MIT"
] | null | null | null | from django.template import loader, Context, RequestContext
import stomp
import json
def push_with_template(template, context, destination):
'''
Pushes content through stomp / morbidQ to comet listeners.
This drives a lot of the "live" content on our site.
'''
t = loader.get_template(template) #Pro... | 38.833333 | 163 | 0.714592 |
46540f947ac818848efeb6e75d1f8e128fe673c8 | 672 | py | Python | manage.py | VektorelPythonHIA23/WebProje | 8dc6b8116cf4ca1aa93b098721eb7e09445a9a15 | [
"MIT"
] | null | null | null | manage.py | VektorelPythonHIA23/WebProje | 8dc6b8116cf4ca1aa93b098721eb7e09445a9a15 | [
"MIT"
] | null | null | null | manage.py | VektorelPythonHIA23/WebProje | 8dc6b8116cf4ca1aa93b098721eb7e09445a9a15 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'VektorelPython23.settings')
try:
from django.core.management import execute_from_command_line
ex... | 29.217391 | 80 | 0.683036 |
917f97ec9ab7bf7cd1a72eeadfba0ba3543c1f56 | 3,162 | py | Python | table_recognition/get_val_gt.py | cuongngm/TableMASTER-mmocr | 77efbc420a80f257eb6947a076a50f61c72344bd | [
"Apache-2.0"
] | 206 | 2021-07-30T09:04:08.000Z | 2022-03-22T00:57:44.000Z | table_recognition/get_val_gt.py | cuongngm/TableMASTER-mmocr | 77efbc420a80f257eb6947a076a50f61c72344bd | [
"Apache-2.0"
] | 39 | 2021-08-05T07:16:46.000Z | 2022-03-14T13:23:48.000Z | table_recognition/get_val_gt.py | cuongngm/TableMASTER-mmocr | 77efbc420a80f257eb6947a076a50f61c72344bd | [
"Apache-2.0"
] | 61 | 2021-07-30T07:51:41.000Z | 2022-03-30T14:40:02.000Z | import os
import json
import json_lines
from tqdm import tqdm
def searchMerge(tokensList):
pointer = 0
mergedTokenList = []
while tokensList[pointer]!='</tbody>':
if tokensList[pointer]=='<td>':
tmp=tokensList[pointer]+tokensList[pointer+1]
mergedTokenList.append(tmp)
... | 36.344828 | 143 | 0.501898 |
83c28240edc94a444e933463e7071d760509ed8b | 1,069 | py | Python | network_health_service/setup.py | kkkkv/tgnms | a3b8fd8a69b647a614f9856933f05e50a4affadf | [
"MIT"
] | 12 | 2021-04-06T06:27:18.000Z | 2022-03-18T10:52:29.000Z | network_health_service/setup.py | kkkkv/tgnms | a3b8fd8a69b647a614f9856933f05e50a4affadf | [
"MIT"
] | 6 | 2022-01-04T13:32:16.000Z | 2022-03-28T21:13:59.000Z | network_health_service/setup.py | kkkkv/tgnms | a3b8fd8a69b647a614f9856933f05e50a4affadf | [
"MIT"
] | 7 | 2021-09-27T13:14:42.000Z | 2022-03-28T16:24:15.000Z | #!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
from setuptools import find_packages, setup
ptr_params = {
"entry_point_module": "network_health_service/main",
"test_suite": "tests.base",
"test_suite_timeout": 300,
"required_coverage": {
"network_health_service/... | 28.891892 | 88 | 0.645463 |
e6379a00da2446f993f974f40e97ed81ce17cc42 | 465 | py | Python | adapters/samsung/sensor_door.py | michahagg/domoticz-zigbee2mqtt-plugin | 0d891a0bd96ed26547904ae8402a26e684dc8e35 | [
"MIT"
] | 1 | 2021-01-17T16:53:44.000Z | 2021-01-17T16:53:44.000Z | adapters/samsung/sensor_door.py | schurgan/zigbee2mqtt-plugin | 41042bc52d34ad503812154a11d7f63aede44c71 | [
"MIT"
] | null | null | null | adapters/samsung/sensor_door.py | schurgan/zigbee2mqtt-plugin | 41042bc52d34ad503812154a11d7f63aede44c71 | [
"MIT"
] | null | null | null | from adapters.adapter_with_battery import AdapterWithBattery
from devices.sensor.door_contact import DoorContactSensor
from devices.sensor.temperature import TemperatureSensor
class SmartThingsDoorSensor(AdapterWithBattery):
def __init__(self, devices):
super().__init__(devices)
self.devices.appen... | 42.272727 | 93 | 0.787097 |
6b3b21e54188815f15dcf7577a8537ea175794ac | 201 | py | Python | braindecode/models/__init__.py | TonioBall/braindecode | d5b8d87d959c96ea8422e21099e1ef4b71b9d05a | [
"BSD-3-Clause"
] | null | null | null | braindecode/models/__init__.py | TonioBall/braindecode | d5b8d87d959c96ea8422e21099e1ef4b71b9d05a | [
"BSD-3-Clause"
] | null | null | null | braindecode/models/__init__.py | TonioBall/braindecode | d5b8d87d959c96ea8422e21099e1ef4b71b9d05a | [
"BSD-3-Clause"
] | null | null | null | """
Some predefined network architectures for EEG decoding.
"""
from .deep4 import Deep4Net
from .eegnet import EEGNetv4
from .hybrid import HybridNetModule
from .shallow_fbcsp import ShallowFBCSPNet
| 22.333333 | 55 | 0.81592 |
3683e6722bf0fd8467127c15ad0dfa118912d14e | 7,406 | py | Python | skyportal/handlers/api/taxonomy.py | steveschulze/skyportal | 47e334d71e34e82ff41bd0e32326e4107741e8e6 | [
"BSD-3-Clause"
] | null | null | null | skyportal/handlers/api/taxonomy.py | steveschulze/skyportal | 47e334d71e34e82ff41bd0e32326e4107741e8e6 | [
"BSD-3-Clause"
] | null | null | null | skyportal/handlers/api/taxonomy.py | steveschulze/skyportal | 47e334d71e34e82ff41bd0e32326e4107741e8e6 | [
"BSD-3-Clause"
] | null | null | null | from tdtax import schema, validate
from jsonschema.exceptions import ValidationError as JSONValidationError
from baselayer.app.access import permissions, auth_or_token
from ..base import BaseHandler
from ...models import DBSession, Taxonomy, Group
class TaxonomyHandler(BaseHandler):
@auth_or_token
def get(se... | 32.060606 | 87 | 0.491628 |
eef12fb4e7183f5d11d04b5cf7d0b157a732c90e | 23,310 | py | Python | tacred_5shot.py | qcwthu/Continual_Fewshot_Relation_Learning | 9d94a9ddc9de6300deec1d5bd434cda0a7a3f1eb | [
"MIT"
] | null | null | null | tacred_5shot.py | qcwthu/Continual_Fewshot_Relation_Learning | 9d94a9ddc9de6300deec1d5bd434cda0a7a3f1eb | [
"MIT"
] | null | null | null | tacred_5shot.py | qcwthu/Continual_Fewshot_Relation_Learning | 9d94a9ddc9de6300deec1d5bd434cda0a7a3f1eb | [
"MIT"
] | null | null | null | import os
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import sys
import json
import gc
from tqdm import tqdm
from sklearn.cluster import KMeans
from encode import lstm_encoder
from dataprocess_tacred import data_sampler
from model import pro... | 43.488806 | 166 | 0.57825 |
25b5ea514438cb8a32e933f41f7aac69d3d89fc9 | 3,226 | py | Python | hello_world/hello_world/settings.py | swilliams704/django-hello-world | 94bd3784cc93d7a49ec50c82cd1384e95c9bede3 | [
"Apache-2.0"
] | null | null | null | hello_world/hello_world/settings.py | swilliams704/django-hello-world | 94bd3784cc93d7a49ec50c82cd1384e95c9bede3 | [
"Apache-2.0"
] | null | null | null | hello_world/hello_world/settings.py | swilliams704/django-hello-world | 94bd3784cc93d7a49ec50c82cd1384e95c9bede3 | [
"Apache-2.0"
] | null | null | null | """
Django settings for hello_world project.
Generated by 'django-admin startproject' using Django 3.0.8.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import o... | 25.603175 | 91 | 0.686299 |
23640bde89679632cdcacac6cfe355008293db58 | 1,880 | py | Python | python/sparkts/models/ARGARCH.py | shenjian74/spark-timeseries | 05edf228791a2fe28de28984618fbcb10d1a5fc1 | [
"Apache-2.0"
] | 1 | 2018-10-23T22:12:07.000Z | 2018-10-23T22:12:07.000Z | python/sparkts/models/ARGARCH.py | shenjian74/spark-timeseries | 05edf228791a2fe28de28984618fbcb10d1a5fc1 | [
"Apache-2.0"
] | 1 | 2018-10-26T21:48:29.000Z | 2018-10-26T21:48:29.000Z | python/sparkts/models/ARGARCH.py | shenjian74/spark-timeseries | 05edf228791a2fe28de28984618fbcb10d1a5fc1 | [
"Apache-2.0"
] | null | null | null | from sparkts.models._model import PyModel
from pyspark.mllib.common import _py2java, _java2py
from pyspark.mllib.linalg import Vectors
"""
"""
def fit_model(ts, sc=None):
"""
Fits an AR(1) + GARCH(1, 1) model to the given time series.
Parameters
----------
ts:
the time series to whic... | 31.333333 | 110 | 0.61117 |
f851986d4a5689059de50195f60832dfa5a99180 | 214 | py | Python | lesson-04/classwork/cw-04-02.py | Evgesha3425/lessons2 | 84f93b83d7ab4d33809cffceaec9a1f22c32856c | [
"BSD-2-Clause"
] | 1 | 2021-11-14T13:06:45.000Z | 2021-11-14T13:06:45.000Z | lesson-04/classwork/cw-04-02.py | Evgesha3425/lessons | 84f93b83d7ab4d33809cffceaec9a1f22c32856c | [
"BSD-2-Clause"
] | null | null | null | lesson-04/classwork/cw-04-02.py | Evgesha3425/lessons | 84f93b83d7ab4d33809cffceaec9a1f22c32856c | [
"BSD-2-Clause"
] | null | null | null | """
Написать программу, которая выведет на экран все числа от 1 до 100 которые кратные n (n вводится с клавиатуры).
"""
n = int(input("Enter number: "))
for x in range(1, 101):
if x % n == 0:
print(x) | 23.777778 | 111 | 0.630841 |
c2841cb2dec7cf1af81f430bee27a5b150863f43 | 1,007 | py | Python | football_analytics_platform/source/_archive/upload_cloud_storage.py | JonNixonCodes/football-analytics-platform | 8be8e7f2a3638f74490462013b0e91db1b2be98d | [
"MIT"
] | null | null | null | football_analytics_platform/source/_archive/upload_cloud_storage.py | JonNixonCodes/football-analytics-platform | 8be8e7f2a3638f74490462013b0e91db1b2be98d | [
"MIT"
] | null | null | null | football_analytics_platform/source/_archive/upload_cloud_storage.py | JonNixonCodes/football-analytics-platform | 8be8e7f2a3638f74490462013b0e91db1b2be98d | [
"MIT"
] | null | null | null | # upload_cloud_storage.py
# %% Import libraries
import os
import re
from google.cloud import storage
# %% Define functions
def set_google_application_credentials(credentials_file_path):
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = credentials_file_path
def extract_blob_path(dest_folder_path, src_file_path):
... | 34.724138 | 79 | 0.753724 |
01a5f59cd263bfac70e0e7b83bd7f02a9c3e575a | 3,578 | py | Python | src/docReader.py | emmanuelmacharia/document-parser | 1c5582f27d0fd84a18af7eb80cdc7c75c8d810d7 | [
"MIT"
] | null | null | null | src/docReader.py | emmanuelmacharia/document-parser | 1c5582f27d0fd84a18af7eb80cdc7c75c8d810d7 | [
"MIT"
] | null | null | null | src/docReader.py | emmanuelmacharia/document-parser | 1c5582f27d0fd84a18af7eb80cdc7c75c8d810d7 | [
"MIT"
] | null | null | null | import os
import re
from dateutil.parser import parse
from collections.abc import Iterable
import lxml.html
import csv
import docx
from docx2python import docx2python
def flatten(l):
for el in l:
if isinstance(el, Iterable) and not isinstance(el, (str, bytes)):
yield from flatten(el)
... | 27.953125 | 141 | 0.589435 |
f508472c364b682f3e0bcfa8646b334b3ee05c5f | 9,142 | py | Python | ibis/tests/expr/test_signature.py | hussainsultan/ibis | cc6cfd49ce9ead3e793734b8e56b87040be093fc | [
"Apache-2.0"
] | null | null | null | ibis/tests/expr/test_signature.py | hussainsultan/ibis | cc6cfd49ce9ead3e793734b8e56b87040be093fc | [
"Apache-2.0"
] | null | null | null | ibis/tests/expr/test_signature.py | hussainsultan/ibis | cc6cfd49ce9ead3e793734b8e56b87040be093fc | [
"Apache-2.0"
] | null | null | null | from inspect import Signature
import pytest
from toolz import identity
from ibis.expr.signature import (
Annotable,
Argument,
Optional,
Parameter,
Validator,
)
from ibis.tests.util import assert_pickle_roundtrip
class ValidatorFunction(Validator):
def __init__(self, fn):
self.fn = fn... | 25.824859 | 78 | 0.63531 |
d5187f01708a4f176f5149c2db54abe75dfed1d8 | 3,751 | py | Python | example.py | jaxxtrend/NodeGraphQt | 86dca1efac5a576eeda3bb361b330d490a4be89b | [
"MIT"
] | null | null | null | example.py | jaxxtrend/NodeGraphQt | 86dca1efac5a576eeda3bb361b330d490a4be89b | [
"MIT"
] | null | null | null | example.py | jaxxtrend/NodeGraphQt | 86dca1efac5a576eeda3bb361b330d490a4be89b | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
from NodeGraphQt import NodeGraph
from NodeGraphQt import BaseNode
from NodeGraphQt import BackdropNode
from NodeGraphQt import NodeTreeWidget
from NodeGraphQt import setup_context_menu
from NodeGraphQt import PropertiesBinWidget
from NodeGraphQt import Qt... | 30.495935 | 75 | 0.620368 |
17d180e401adccbce8af6ab0fa1806ca467d512d | 17,967 | py | Python | Ridiculous_Pullup/cup_movement1.py | hpladds/Crop_Circle_Coffeemaker_V1.0 | 22ab7fb162475106675d052bcb81210dd7fe6c1f | [
"MIT"
] | null | null | null | Ridiculous_Pullup/cup_movement1.py | hpladds/Crop_Circle_Coffeemaker_V1.0 | 22ab7fb162475106675d052bcb81210dd7fe6c1f | [
"MIT"
] | null | null | null | Ridiculous_Pullup/cup_movement1.py | hpladds/Crop_Circle_Coffeemaker_V1.0 | 22ab7fb162475106675d052bcb81210dd7fe6c1f | [
"MIT"
] | null | null | null | import RPi.GPIO as GPIO
import time
import sys
import math
#from math import cos, sin, radians, sqrt, pow
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
coil_A_1_pin1 = 27 #orange
coil_A_2_pin1 = 22 #yellow
coil_B_1_pin1 = 10 #pink
coil_B_2_pin1 = 9 #blue
coil_A_1_pin3 = 21 #orange
coil_A_2_pin3 = 20 #yello... | 29.648515 | 228 | 0.631435 |
35d2ebc9b9f78694a33df22f9db436a532dbf1e5 | 9,163 | py | Python | pytorchvideo/layers/convolutions.py | kevinmtian/pytorchvideo | 168e16859a6029ef8ebeb476f9163bebb6c6b87d | [
"Apache-2.0"
] | 2,391 | 2021-04-13T18:10:18.000Z | 2022-03-31T15:07:09.000Z | pytorchvideo/layers/convolutions.py | kevinmtian/pytorchvideo | 168e16859a6029ef8ebeb476f9163bebb6c6b87d | [
"Apache-2.0"
] | 156 | 2021-04-13T18:51:49.000Z | 2022-03-31T08:05:50.000Z | pytorchvideo/layers/convolutions.py | kevinmtian/pytorchvideo | 168e16859a6029ef8ebeb476f9163bebb6c6b87d | [
"Apache-2.0"
] | 231 | 2021-04-14T05:04:55.000Z | 2022-03-22T09:35:46.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
from typing import Callable, Optional, Tuple
import torch
import torch.nn as nn
from pytorchvideo.layers.utils import set_attributes
from torch.nn.common_types import _size_3_t
class ConvReduce3D(nn.Module):
"""
Builds a list of convolu... | 38.5 | 89 | 0.588235 |
f07af40f6ded3e2cb53b63c252cbab1e5f4330aa | 2,221 | py | Python | tests/m2m_through_regress/test_multitable.py | JBKahn/django | 32265361279b3316f5bce8efa71f2049409461e3 | [
"PSF-2.0",
"BSD-3-Clause"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | tests/m2m_through_regress/test_multitable.py | 287977288/test | 142e3626ab3c676574631383ae6b5a4eced5a10e | [
"PSF-2.0",
"BSD-3-Clause"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | tests/m2m_through_regress/test_multitable.py | 287977288/test | 142e3626ab3c676574631383ae6b5a4eced5a10e | [
"PSF-2.0",
"BSD-3-Clause"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | from __future__ import unicode_literals
from django.test import TestCase
from .models import (
CompetingTeam, Event, Group, IndividualCompetitor, Membership, Person,
)
class MultiTableTests(TestCase):
@classmethod
def setUpTestData(cls):
cls.alice = Person.objects.create(name='Alice')
cl... | 42.711538 | 111 | 0.699235 |
18d7182295b130fd860b9460ee1ac341bc29d1ed | 999 | py | Python | 2015/day12/day12.py | naitmare01/Adventofcode | 34f2832fa7a18b76cf9827890632740c6f60679c | [
"MIT"
] | null | null | null | 2015/day12/day12.py | naitmare01/Adventofcode | 34f2832fa7a18b76cf9827890632740c6f60679c | [
"MIT"
] | null | null | null | 2015/day12/day12.py | naitmare01/Adventofcode | 34f2832fa7a18b76cf9827890632740c6f60679c | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import argparse
import re
import json
def arguments():
# Handle command line arguments
parser = argparse.ArgumentParser(description='Adventofcode.')
parser.add_argument('-f', '--file', required=True)
args = parser.parse_args()
return args
def calculat... | 22.704545 | 69 | 0.646647 |
b7eda156ebf57693a66daee90fa3693629496290 | 2,321 | py | Python | model/intialisation.py | xhelenfu/Lung-Nodule-Attributes-CT-Network | ce8234920b26a16a8a87ab0f78b53a29152d8aae | [
"MIT"
] | null | null | null | model/intialisation.py | xhelenfu/Lung-Nodule-Attributes-CT-Network | ce8234920b26a16a8a87ab0f78b53a29152d8aae | [
"MIT"
] | null | null | null | model/intialisation.py | xhelenfu/Lung-Nodule-Attributes-CT-Network | ce8234920b26a16a8a87ab0f78b53a29152d8aae | [
"MIT"
] | null | null | null | from torch.nn import init
def weights_init_normal(m):
classname = m.__class__.__name__
if classname.find('Conv') != -1:
init.normal_(m.weight.data, 0.0, 0.02)
elif classname.find('Linear') != -1:
init.normal_(m.weight.data, 0.0, 0.02)
elif classname.find('BatchNorm') != -1:
ini... | 34.132353 | 94 | 0.642826 |
bc76a76d57581bae4865293a2d7688d204ea1bca | 2,766 | py | Python | modelling/blocks/prior_analysis.py | hieu1999210/image_compression | 3faf90d704782e1d6a186b0c8ea7fb1e2ec97a2c | [
"Apache-2.0"
] | null | null | null | modelling/blocks/prior_analysis.py | hieu1999210/image_compression | 3faf90d704782e1d6a186b0c8ea7fb1e2ec97a2c | [
"Apache-2.0"
] | null | null | null | modelling/blocks/prior_analysis.py | hieu1999210/image_compression | 3faf90d704782e1d6a186b0c8ea7fb1e2ec97a2c | [
"Apache-2.0"
] | null | null | null | """
modified by Hieu Nguyen
adapted from Tensorflow to Pytorch implementation
"""
# Copyright 2020 Hieu Nguyen
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.ap... | 38.416667 | 91 | 0.610268 |
474cbe78a64fbf4ac40474772af02879e8ac1c83 | 226 | py | Python | lazy_lxd/lib/lxd/__init__.py | vladisnik/lazy-lxd | 04c8ddb286af5ccab0f7627dec3ea8e12f4408ba | [
"MIT"
] | 3 | 2020-08-11T13:50:44.000Z | 2020-08-17T10:26:56.000Z | lazy_lxd/lib/lxd/__init__.py | vladisnik/lazy-lxd | 04c8ddb286af5ccab0f7627dec3ea8e12f4408ba | [
"MIT"
] | null | null | null | lazy_lxd/lib/lxd/__init__.py | vladisnik/lazy-lxd | 04c8ddb286af5ccab0f7627dec3ea8e12f4408ba | [
"MIT"
] | null | null | null | """
Additional layer between LXD API and client.
Client supplemented by some useful functions.
Such as downloading image, wrappers above container states, etc.
"""
from .client import LXDClient
__all__ = [
'LXDClient'
]
| 18.833333 | 64 | 0.752212 |
cef27e3d47afaa1a5483b62221cf48f4866bf99f | 38,704 | py | Python | albert/run_classifier_sp.py | pertschuk/google-research | 2a412e4c3654abcfccf9118116cbc73c801e6409 | [
"Apache-2.0"
] | null | null | null | albert/run_classifier_sp.py | pertschuk/google-research | 2a412e4c3654abcfccf9118116cbc73c801e6409 | [
"Apache-2.0"
] | null | null | null | albert/run_classifier_sp.py | pertschuk/google-research | 2a412e4c3654abcfccf9118116cbc73c801e6409 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2019 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 35.21747 | 92 | 0.686079 |
3cd9efc801dd659d6d3a30ff54a029847ae00680 | 2,552 | py | Python | tests/components/whois/test_init.py | PiotrMachowski/core | b9d7d0cae2ccd2d88e90e49cc09e154a27ed809b | [
"Apache-2.0"
] | 1 | 2018-08-01T02:37:08.000Z | 2018-08-01T02:37:08.000Z | tests/components/whois/test_init.py | PiotrMachowski/core | b9d7d0cae2ccd2d88e90e49cc09e154a27ed809b | [
"Apache-2.0"
] | 18 | 2021-11-24T06:26:13.000Z | 2022-03-31T06:25:15.000Z | tests/components/whois/test_init.py | PiotrMachowski/core | b9d7d0cae2ccd2d88e90e49cc09e154a27ed809b | [
"Apache-2.0"
] | 3 | 2021-11-14T13:29:33.000Z | 2021-12-27T17:05:22.000Z | """Tests for the Whois integration."""
from unittest.mock import MagicMock
import pytest
from whois.exceptions import (
FailedParsingWhoisOutput,
UnknownDateFormat,
UnknownTld,
WhoisCommandFailed,
)
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.components.whois... | 31.506173 | 82 | 0.768417 |
7da14efebc2bd2315aee52ddd4428d9e86d4db82 | 17,841 | py | Python | tests/test_sampler.py | jackraymond/dwave-neal | 3d9f4816b59e8c59d095f994a57b10e88ac816da | [
"Apache-2.0"
] | null | null | null | tests/test_sampler.py | jackraymond/dwave-neal | 3d9f4816b59e8c59d095f994a57b10e88ac816da | [
"Apache-2.0"
] | null | null | null | tests/test_sampler.py | jackraymond/dwave-neal | 3d9f4816b59e8c59d095f994a57b10e88ac816da | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 D-Wave Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 39.646667 | 115 | 0.554846 |
b0a85784c923734a97189a0909e0a167abafd929 | 10,616 | py | Python | src/cognito_auth_server/server.py | mathewmoon/cognito-auth-server | 6deb59de32e479fdc6a04e27390ef4cb70421723 | [
"Apache-2.0"
] | null | null | null | src/cognito_auth_server/server.py | mathewmoon/cognito-auth-server | 6deb59de32e479fdc6a04e27390ef4cb70421723 | [
"Apache-2.0"
] | null | null | null | src/cognito_auth_server/server.py | mathewmoon/cognito-auth-server | 6deb59de32e479fdc6a04e27390ef4cb70421723 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3.8
from os import (
path,
R_OK,
W_OK,
access,
chmod,
chown,
remove,
stat,
environ,
chdir
)
from socketserver import (
TCPServer as TCPSocketServer,
UnixStreamServer,
BaseRequestHandler
)
from pwd import getpwnam
from stat import S_ISSOCK
from log... | 32.968944 | 146 | 0.611059 |
62ff22711b889f7cfc62084815f6ebbc36b5ced6 | 2,743 | py | Python | dvc/objects/db/reference.py | lucasalavapena/dvc | 230eb7087df7f063ded7422af7ae45bd04eb794a | [
"Apache-2.0"
] | null | null | null | dvc/objects/db/reference.py | lucasalavapena/dvc | 230eb7087df7f063ded7422af7ae45bd04eb794a | [
"Apache-2.0"
] | 87 | 2021-04-27T08:17:31.000Z | 2022-03-30T12:12:40.000Z | dvc/objects/db/reference.py | lucasalavapena/dvc | 230eb7087df7f063ded7422af7ae45bd04eb794a | [
"Apache-2.0"
] | null | null | null | import io
import logging
import os
from typing import TYPE_CHECKING, Dict
from dvc.scheme import Schemes
from ..errors import ObjectFormatError
from ..reference import ReferenceHashFile
from .base import ObjectDB
if TYPE_CHECKING:
from dvc.fs.base import BaseFileSystem
from dvc.hash_info import HashInfo
... | 30.820225 | 79 | 0.595334 |
3b2402c9a039380327273f22d5eb4bcecdbd0ad0 | 5,873 | py | Python | evennia/contrib/tutorial_examples/red_button.py | pakhnu/my-world | 405983dca81e70fc64d58d6a60126ffa5e8ada8c | [
"BSD-3-Clause"
] | 9 | 2017-07-10T04:27:31.000Z | 2020-07-31T08:54:08.000Z | evennia/contrib/tutorial_examples/red_button.py | pakhnu/my-world | 405983dca81e70fc64d58d6a60126ffa5e8ada8c | [
"BSD-3-Clause"
] | null | null | null | evennia/contrib/tutorial_examples/red_button.py | pakhnu/my-world | 405983dca81e70fc64d58d6a60126ffa5e8ada8c | [
"BSD-3-Clause"
] | 4 | 2017-09-11T02:26:21.000Z | 2021-12-31T05:20:34.000Z | """
This is a more advanced example object. It combines functions from
script.examples as well as commands.examples to make an interactive
button typeclass.
Create this button with
@create/drop examples.red_button.RedButton
Note that you must drop the button before you can see its messages!
"""
import random
from ... | 35.167665 | 91 | 0.641069 |
3c11e9b36e1b5da3d594787007028a180a13e8c8 | 5,129 | py | Python | listener/normal/error/forms.py | andymckay/arecibo | eb6787ea0a276047ef5add2df67a4dd051e5c961 | [
"Apache-2.0"
] | 6 | 2016-01-26T04:47:52.000Z | 2022-01-24T19:55:04.000Z | listener/normal/error/forms.py | andymckay/arecibo | eb6787ea0a276047ef5add2df67a4dd051e5c961 | [
"Apache-2.0"
] | 6 | 2017-02-12T05:11:25.000Z | 2017-02-12T05:12:15.000Z | listener/normal/error/forms.py | andymckay/arecibo | eb6787ea0a276047ef5add2df67a4dd051e5c961 | [
"Apache-2.0"
] | 2 | 2015-12-09T22:37:58.000Z | 2021-09-09T17:04:33.000Z | from datetime import datetime, timedelta
import operator
from django import forms
from django.db.models import Q
from app.forms import Form, ModelForm
from app.utils import memoize, safe_int
from projects.models import ProjectURL
from error.models import Error, Group
read_choices = (("", "All"), ("True", 'Read only... | 32.878205 | 86 | 0.585884 |
c587ab6f39b6e60c14d8890c44786db6bc12a15f | 43,647 | py | Python | 17tensorflow/6_bert/fine_tune_squad.py | cheerfulwang/python-tutorial | d0f7348e1da4ff954e3add66e1aae55d599283ee | [
"Apache-2.0"
] | 2 | 2021-01-04T10:44:44.000Z | 2022-02-13T07:53:41.000Z | 17tensorflow/6_bert/fine_tune_squad.py | zm79287/python-tutorial | d0f7348e1da4ff954e3add66e1aae55d599283ee | [
"Apache-2.0"
] | null | null | null | 17tensorflow/6_bert/fine_tune_squad.py | zm79287/python-tutorial | d0f7348e1da4ff954e3add66e1aae55d599283ee | [
"Apache-2.0"
] | 2 | 2020-11-23T08:58:51.000Z | 2022-02-13T07:53:42.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team.
#
# 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/LICENS... | 44.904321 | 119 | 0.60916 |
f0501b3f3eb9c926e5df5bab1da6086170777fde | 14,774 | py | Python | tensorflow/contrib/training/python/training/sampling_ops_test.py | atfkaka/tensorflow | 5657d0dee8d87f4594b3e5902ed3e3ca8d6dfc0a | [
"Apache-2.0"
] | 101 | 2016-12-03T11:40:52.000Z | 2017-12-23T02:02:03.000Z | tensorflow/contrib/training/python/training/sampling_ops_test.py | atfkaka/tensorflow | 5657d0dee8d87f4594b3e5902ed3e3ca8d6dfc0a | [
"Apache-2.0"
] | 9 | 2016-12-14T03:27:46.000Z | 2017-09-13T02:29:07.000Z | tensorflow/contrib/training/python/training/sampling_ops_test.py | atfkaka/tensorflow | 5657d0dee8d87f4594b3e5902ed3e3ca8d6dfc0a | [
"Apache-2.0"
] | 47 | 2016-12-04T12:37:24.000Z | 2018-01-14T18:13:07.000Z | # Copyright 2016 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... | 37.497462 | 115 | 0.668472 |
33b8e9bbe31032d4f4b5a440fae08676797f7bf5 | 11,483 | py | Python | carbon_from_biovolume_grabber.py | snifflesnrumjum/IFCB_analysis | 46ce192eecbea1d61a865b963c47d3daef351d44 | [
"MIT"
] | null | null | null | carbon_from_biovolume_grabber.py | snifflesnrumjum/IFCB_analysis | 46ce192eecbea1d61a865b963c47d3daef351d44 | [
"MIT"
] | null | null | null | carbon_from_biovolume_grabber.py | snifflesnrumjum/IFCB_analysis | 46ce192eecbea1d61a865b963c47d3daef351d44 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Feb 17 2015
This script will grab the biovolume feature data from extracted feature files
for all images in an automated class file.
Can bin data by category or leave each image separate.
@author: Darren Henrichs
"""
# script to extract the biovolume estimates from IFCB V2 f... | 50.364035 | 154 | 0.67404 |
f6fc1952b9998ff3ec460c7113711405116c4669 | 10,043 | py | Python | src/RL/ComplexityKnobs.py | Voice-First-AI/generative-music-watson | e666f64602baab2e35a66c0a5c4389b1bd5666c9 | [
"Apache-2.0"
] | null | null | null | src/RL/ComplexityKnobs.py | Voice-First-AI/generative-music-watson | e666f64602baab2e35a66c0a5c4389b1bd5666c9 | [
"Apache-2.0"
] | null | null | null | src/RL/ComplexityKnobs.py | Voice-First-AI/generative-music-watson | e666f64602baab2e35a66c0a5c4389b1bd5666c9 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
Actions = {
'bass1': {
0:'PLAY_CHORD_PROGRESSION_TONE_SML_JUMP',
1:'PLAY_CHORD_PROGRESSION_TONE_MID_JUMP',
2:'PLAY_CHORD_PROGRESSION_TONE_BIG_JUMP',
3:'PLAY_CHORD_PROGRESSION_TONE_FOR_PRIMARY_KE... | 34.276451 | 199 | 0.466195 |
04a2294e7327e3dc88c1ddd33a9f8bd270950964 | 407 | py | Python | tests/seahub/views/init/test_repo_download_dir.py | samuelduann/seahub | 90ce99e8aa27e3e127aedff2eb2f2ee75228b857 | [
"Apache-2.0"
] | 420 | 2015-01-03T11:34:46.000Z | 2022-03-10T07:15:41.000Z | tests/seahub/views/init/test_repo_download_dir.py | samuelduann/seahub | 90ce99e8aa27e3e127aedff2eb2f2ee75228b857 | [
"Apache-2.0"
] | 735 | 2015-01-04T21:22:51.000Z | 2022-03-31T09:26:07.000Z | tests/seahub/views/init/test_repo_download_dir.py | samuelduann/seahub | 90ce99e8aa27e3e127aedff2eb2f2ee75228b857 | [
"Apache-2.0"
] | 379 | 2015-01-05T17:08:03.000Z | 2022-03-06T00:11:50.000Z | from django.urls import reverse
from seahub.test_utils import BaseTestCase
class RepoDownloadDirTest(BaseTestCase):
def setUp(self):
self.login_as(self.user)
def test_can_render(self):
resp = self.client.get(reverse('repo_download_dir', args=[self.repo.id]) + '?p=' + self.folder)
sel... | 29.071429 | 103 | 0.700246 |
983bd49a117763b699e45c32c51a0544c73ed0e8 | 13,040 | py | Python | www/src/Lib/test/test_email/test_policy.py | raspberrypieman/brython | 2cc23d1da6acda604d4a56b4c9d464eb7e374eda | [
"BSD-3-Clause"
] | 5,926 | 2015-01-01T07:45:08.000Z | 2022-03-31T12:34:38.000Z | www/src/Lib/test/test_email/test_policy.py | raspberrypieman/brython | 2cc23d1da6acda604d4a56b4c9d464eb7e374eda | [
"BSD-3-Clause"
] | 1,728 | 2015-01-01T01:09:12.000Z | 2022-03-30T23:25:22.000Z | check-python33-manual/samples/standard_library_337/Lib/test/test_email/test_policy.py | DaveKaretnyk/parsing-utils2 | 40085bbd399fa605f2f2a4708d385a64ffc907de | [
"MIT"
] | 574 | 2015-01-02T01:36:10.000Z | 2022-03-26T10:18:48.000Z | import io
import types
import textwrap
import unittest
import email.policy
import email.parser
import email.generator
from email import headerregistry
def make_defaults(base_defaults, differences):
defaults = base_defaults.copy()
defaults.update(differences)
return defaults
class PolicyAPITests(unittest.T... | 40.371517 | 80 | 0.625767 |
39bda80ab2fb5c028dbbcbb14c6913ffe7ebe634 | 147 | py | Python | toolchain/riscv/MSYS/python/Lib/test/test_importlib/source/__init__.py | zhiqiang-hu/bl_iot_sdk | 154ee677a8cc6a73e6a42a5ff12a8edc71e6d15d | [
"Apache-2.0"
] | 207 | 2018-10-01T08:53:01.000Z | 2022-03-14T12:15:54.000Z | toolchain/riscv/MSYS/python/Lib/test/test_importlib/source/__init__.py | zhiqiang-hu/bl_iot_sdk | 154ee677a8cc6a73e6a42a5ff12a8edc71e6d15d | [
"Apache-2.0"
] | 8 | 2019-06-29T14:18:51.000Z | 2022-02-19T07:30:27.000Z | toolchain/riscv/MSYS/python/Lib/test/test_importlib/source/__init__.py | zhiqiang-hu/bl_iot_sdk | 154ee677a8cc6a73e6a42a5ff12a8edc71e6d15d | [
"Apache-2.0"
] | 76 | 2020-03-16T01:47:46.000Z | 2022-03-21T16:37:07.000Z | import os
from test.support import load_package_tests
def load_tests(*args):
return load_package_tests(os.path.dirname(__file__), *args)
| 24.5 | 64 | 0.768707 |
7930da233ffbf0403b81a7d7713e521996513812 | 5,728 | py | Python | ProcessOscSignal.py | Creative-AI-Research-Group/pysideScore | f7499b12bbe123135901fc4ca52a0fccf6107f38 | [
"MIT"
] | null | null | null | ProcessOscSignal.py | Creative-AI-Research-Group/pysideScore | f7499b12bbe123135901fc4ca52a0fccf6107f38 | [
"MIT"
] | null | null | null | ProcessOscSignal.py | Creative-AI-Research-Group/pysideScore | f7499b12bbe123135901fc4ca52a0fccf6107f38 | [
"MIT"
] | null | null | null | import glob
import random
from operator import itemgetter
from PySide2.QtGui import QImage, QPainter
MAX_SIZE = 500
MAX_LIFESPAN = 250
class ProcessOscSignal:
def __init__(self):
self.queue = []
self.visual_types = ("line",
"ellipse",
"re... | 51.142857 | 104 | 0.417947 |
62eaa83559d8af2742da2b7fbdd3d7c44de1474c | 1,698 | py | Python | CTA1Option1 Dataset Exploration.py | mwchalumeau/github-slideshow | 5273cabc7b5ca5837fee35733b6e85e6d67e8131 | [
"MIT"
] | null | null | null | CTA1Option1 Dataset Exploration.py | mwchalumeau/github-slideshow | 5273cabc7b5ca5837fee35733b6e85e6d67e8131 | [
"MIT"
] | null | null | null | CTA1Option1 Dataset Exploration.py | mwchalumeau/github-slideshow | 5273cabc7b5ca5837fee35733b6e85e6d67e8131 | [
"MIT"
] | null | null | null | #############################################################
#Program name - Data Exploration
#input - NONE
#output - Some Exploration statistics
###############################################################
import pandas as pd
#Create data_frame of array values
df= pd.DataFrame({ 'name':['matt','lisa','ric... | 33.96 | 84 | 0.48881 |
eec1c5c2eeffdaade5785cd0e74d201fbfb5bde5 | 1,142 | py | Python | pykot/api.py | ikasamah/pykot | 2203c679b85463a7b38fce7941af406301cf7819 | [
"MIT"
] | null | null | null | pykot/api.py | ikasamah/pykot | 2203c679b85463a7b38fce7941af406301cf7819 | [
"MIT"
] | null | null | null | pykot/api.py | ikasamah/pykot | 2203c679b85463a7b38fce7941af406301cf7819 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import division, absolute_import, print_function, unicode_literals
import logging
import requests
class V1Api(object):
BASE_URL = 'https://api.kingtime.co.jp/v1.0'
# BASE_URL = 'http://echo.jsontest.com'
def __init__(self, access_token=None):
self.log = lo... | 30.052632 | 110 | 0.634851 |
0537bae6b33c220bf21c4a818856bc34273c1d08 | 6,784 | py | Python | 2018/day_06/solution_p1.py | rvaughan/AdventOfCode2017 | fb9199282c0083cd0b3072c27e63ea83d866efc2 | [
"MIT"
] | null | null | null | 2018/day_06/solution_p1.py | rvaughan/AdventOfCode2017 | fb9199282c0083cd0b3072c27e63ea83d866efc2 | [
"MIT"
] | null | null | null | 2018/day_06/solution_p1.py | rvaughan/AdventOfCode2017 | fb9199282c0083cd0b3072c27e63ea83d866efc2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
This code holds the solution for part 1 of day 6 of the Advent of Code for 2018.
"""
from collections import Counter
import sys
def build_grid(test_input):
co_ords = {}
max_x = 0
max_y = 0
for id, c in zip(xrange(len(test_input)), test_input):
x, y = c.split(', ')
... | 25.992337 | 134 | 0.592276 |
d2defc80486762d367cf5c0c1424c8f242c9128b | 665 | py | Python | imagefactory-plugins/EC2Cloud/__init__.py | henrysher/imagefactory | 6dbcfa773913f1863470adc40c84baac67321bf1 | [
"Apache-2.0"
] | null | null | null | imagefactory-plugins/EC2Cloud/__init__.py | henrysher/imagefactory | 6dbcfa773913f1863470adc40c84baac67321bf1 | [
"Apache-2.0"
] | null | null | null | imagefactory-plugins/EC2Cloud/__init__.py | henrysher/imagefactory | 6dbcfa773913f1863470adc40c84baac67321bf1 | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
# Copyright 2012 Red Hat, 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 applica... | 36.944444 | 76 | 0.73985 |
6dd78d0b4a4003ed069c8aca05f41121ca7b74ea | 3,849 | py | Python | venv/Lib/site-packages/dash_bootstrap_components/_components/RadioButton.py | hanzzhu/chadle | ac1d63b0410bb43f3fab362bb00abfc2e8790b9d | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/dash_bootstrap_components/_components/RadioButton.py | hanzzhu/chadle | ac1d63b0410bb43f3fab362bb00abfc2e8790b9d | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/dash_bootstrap_components/_components/RadioButton.py | hanzzhu/chadle | ac1d63b0410bb43f3fab362bb00abfc2e8790b9d | [
"Apache-2.0"
] | null | null | null | # AUTO GENERATED FILE - DO NOT EDIT
from dash.development.base_component import Component, _explicitize_args
class RadioButton(Component):
"""A RadioButton component.
Creates a single radio button. Use the `checked` prop in your callbacks.
Keyword arguments:
- id (string; optional):
The ID of this componen... | 44.241379 | 368 | 0.704599 |
a8dc10dc350e14ddf5e82f92838c50241637ef17 | 175 | py | Python | wsc_django/wsc_django/apps/ws/routing.py | hzh595395786/wsc_django | c0a4de1a4479fe83f36108c1fdd4d68d18348b8d | [
"MIT"
] | 2 | 2021-02-07T05:56:46.000Z | 2021-05-12T02:11:24.000Z | wsc_django/wsc_django/apps/ws/routing.py | hzh595395786/wsc_django | c0a4de1a4479fe83f36108c1fdd4d68d18348b8d | [
"MIT"
] | null | null | null | wsc_django/wsc_django/apps/ws/routing.py | hzh595395786/wsc_django | c0a4de1a4479fe83f36108c1fdd4d68d18348b8d | [
"MIT"
] | null | null | null | from django.urls import path
from ws import consumers
websocket_urlpatterns = [
path('ws/admin/websocket/', consumers.AdminWebSocketConsumer.as_asgi()), # 后台的websocket
] | 29.166667 | 92 | 0.777143 |
ee158fe00076ccba5138b1d88bed8e364276e2aa | 4,123 | py | Python | tests/test_dict_indexer.py | micro-pixel/gnes | 388d1ba718ec04eedaaff3ce34da43689c197ee7 | [
"Apache-2.0"
] | 2 | 2020-07-05T03:51:44.000Z | 2022-02-18T05:56:37.000Z | tests/test_dict_indexer.py | cmy9068/gnes | 44a54be4c80108ac65b2450b4af8deded6da3339 | [
"Apache-2.0"
] | null | null | null | tests/test_dict_indexer.py | cmy9068/gnes | 44a54be4c80108ac65b2450b4af8deded6da3339 | [
"Apache-2.0"
] | 1 | 2020-10-28T15:07:36.000Z | 2020-10-28T15:07:36.000Z | import os
import unittest
from shutil import rmtree
import grpc
from gnes.cli.parser import set_frontend_parser, set_preprocessor_parser, set_indexer_parser
from gnes.indexer.base import BaseIndexer
from gnes.indexer.doc.filesys import DirectoryIndexer
from gnes.preprocessor.base import BasePreprocessor
from gnes.pro... | 38.896226 | 115 | 0.626243 |
1878cc5e4e563c8eb4f6f5a2ea4d879c3f206220 | 3,006 | py | Python | tests/pytests/schedtester.py | vojtechcima/rain | 39c4b1de952da6673e9eb3247157b9b29b028942 | [
"MIT"
] | null | null | null | tests/pytests/schedtester.py | vojtechcima/rain | 39c4b1de952da6673e9eb3247157b9b29b028942 | [
"MIT"
] | null | null | null | tests/pytests/schedtester.py | vojtechcima/rain | 39c4b1de952da6673e9eb3247157b9b29b028942 | [
"MIT"
] | null | null | null | from rain.client import blob, remote
class Governor:
def __init__(self, cpus):
self.cpus = cpus
self.governor_id = None
class Scenario:
def __init__(self, test_env, governors):
assert all(w.governor_id is None for w in governors)
self.governors = tuple(governors)
se... | 34.953488 | 86 | 0.55489 |
b4c2b2a14dc816bf2e144e461619bb949566d948 | 1,610 | py | Python | ocr/code/neural_network_design.py | kennywbin/500lines | e72f05bac2087f368251d3f263ae325c268e5171 | [
"CC-BY-3.0"
] | null | null | null | ocr/code/neural_network_design.py | kennywbin/500lines | e72f05bac2087f368251d3f263ae325c268e5171 | [
"CC-BY-3.0"
] | null | null | null | ocr/code/neural_network_design.py | kennywbin/500lines | e72f05bac2087f368251d3f263ae325c268e5171 | [
"CC-BY-3.0"
] | null | null | null | """
In order to decide how many hidden nodes the hidden layer should have,
split up the data set into training and testing data and create networks
with various hidden node counts (5, 10, 15, ... 45), testing the performance
for each.
The best-performing node count is used in the actual system. If multiple count... | 37.44186 | 92 | 0.692547 |
b7c3b69c0360c1fd5b988a3247654f1563c63a3c | 416 | py | Python | sfeprapy/func/fire_external_ec.py | fsepy/sfeprapy | 0b1c11b30034793e1231f599cf41e496a9ec56aa | [
"MIT"
] | 4 | 2019-08-22T14:30:43.000Z | 2020-08-30T08:20:48.000Z | sfeprapy/func/fire_external_ec.py | fsepy/sfeprapy | 0b1c11b30034793e1231f599cf41e496a9ec56aa | [
"MIT"
] | 3 | 2019-10-26T11:31:58.000Z | 2019-11-23T11:27:11.000Z | sfeprapy/func/fire_external_ec.py | fsepy/sfeprapy | 0b1c11b30034793e1231f599cf41e496a9ec56aa | [
"MIT"
] | null | null | null | import numpy as np
def fire(time, temperature_initial):
time /= 1200.0 # convert time from seconds to hours
temperature_initial -= 273.15 # convert ambient temperature from kelvin to celsius
temperature = (
660 * (1 - 0.687 * np.exp(-0.32 * time) - 0.313 * np.exp(-3.8 * time))
+ temperat... | 34.666667 | 87 | 0.661058 |
50f9c75dc26b4c73e2a6300cbd8c1873c8268c66 | 582 | py | Python | changes/api/serializer/models/project.py | alex/changes | 69a17b4c639e7082a75d037384ccb68ead3a0b4b | [
"Apache-2.0"
] | 1 | 2015-11-08T13:00:44.000Z | 2015-11-08T13:00:44.000Z | changes/api/serializer/models/project.py | alex/changes | 69a17b4c639e7082a75d037384ccb68ead3a0b4b | [
"Apache-2.0"
] | null | null | null | changes/api/serializer/models/project.py | alex/changes | 69a17b4c639e7082a75d037384ccb68ead3a0b4b | [
"Apache-2.0"
] | null | null | null | from changes.api.serializer import Serializer, register
from changes.models.project import Project
from changes.utils.http import build_uri
@register(Project)
class ProjectSerializer(Serializer):
def serialize(self, instance, attrs):
return {
'id': instance.id.hex,
'slug': instance... | 30.631579 | 70 | 0.606529 |
4b633cb758a2f05189601fe27426ac24b046e189 | 38 | py | Python | src/gutenberg_downloader.py | elijah-rou/InvictusMicroservice | 2f200dccdd28d32c8fb3cc524e128ba13583b7f1 | [
"MIT"
] | null | null | null | src/gutenberg_downloader.py | elijah-rou/InvictusMicroservice | 2f200dccdd28d32c8fb3cc524e128ba13583b7f1 | [
"MIT"
] | null | null | null | src/gutenberg_downloader.py | elijah-rou/InvictusMicroservice | 2f200dccdd28d32c8fb3cc524e128ba13583b7f1 | [
"MIT"
] | null | null | null | import nltk
nltk.download('gutenberg') | 19 | 26 | 0.815789 |
717883bd1be70eb1ff0f859fb851b667b6af22d0 | 1,069 | py | Python | Python/Fundamentals/Lists lab-exercise(Advanced)/The Office.py | EduardV777/Softuni-Python-Exercises | 79db667028aea7dfecb3dbbd834c752180c50f44 | [
"Unlicense"
] | null | null | null | Python/Fundamentals/Lists lab-exercise(Advanced)/The Office.py | EduardV777/Softuni-Python-Exercises | 79db667028aea7dfecb3dbbd834c752180c50f44 | [
"Unlicense"
] | null | null | null | Python/Fundamentals/Lists lab-exercise(Advanced)/The Office.py | EduardV777/Softuni-Python-Exercises | 79db667028aea7dfecb3dbbd834c752180c50f44 | [
"Unlicense"
] | null | null | null | happinessRates=input(); improvementFactor=int(input())
happinessRatesList=[]
k=0
while k<len(happinessRates):
rate=""
if happinessRates[k]!=" ":
for j in range(k,len(happinessRates)):
if happinessRates[j]!=" ":
rate+=happinessRates[j]
k+=1
... | 39.592593 | 100 | 0.678204 |
d5555beab42391bb32d833de8ce3662404f33c65 | 38,461 | py | Python | python/cudf/cudf/tests/test_multiindex.py | manopapad/cudf | 7c8961459e67f0a82f79327a5fd87ef6887ecc83 | [
"Apache-2.0"
] | null | null | null | python/cudf/cudf/tests/test_multiindex.py | manopapad/cudf | 7c8961459e67f0a82f79327a5fd87ef6887ecc83 | [
"Apache-2.0"
] | null | null | null | python/cudf/cudf/tests/test_multiindex.py | manopapad/cudf | 7c8961459e67f0a82f79327a5fd87ef6887ecc83 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019-2020, NVIDIA CORPORATION.
"""
Test related to MultiIndex
"""
import itertools
import operator
import re
import cupy as cp
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf.core.column import as_column
from cudf.core.index import as_index
from cudf.tests.utils import asse... | 28.638124 | 79 | 0.492993 |
36b20fedcdec9b9e3662c9776727b4c338634507 | 759 | py | Python | sunkit_dem/tests/test_util.py | PaulJWright/sunkit-dem-sandbox | 804cf5315487568050637e27bb84e5c2eb640ba2 | [
"BSD-3-Clause"
] | null | null | null | sunkit_dem/tests/test_util.py | PaulJWright/sunkit-dem-sandbox | 804cf5315487568050637e27bb84e5c2eb640ba2 | [
"BSD-3-Clause"
] | null | null | null | sunkit_dem/tests/test_util.py | PaulJWright/sunkit-dem-sandbox | 804cf5315487568050637e27bb84e5c2eb640ba2 | [
"BSD-3-Clause"
] | null | null | null | """
Tests for utilities
"""
import pytest
import numpy as np
import astropy.units as u
from sunkit_dem.util import quantity_1d_to_sequence
wavelengths = np.linspace(0, 1, 10) * u.angstrom
intensities = np.random.rand(wavelengths.shape[0]) * u.ct
@pytest.fixture
def sequence1d():
return quantity_1d_to_sequence(i... | 24.483871 | 73 | 0.766798 |
4f6d2fdc3684580cf77cc6b132f9ba9ee858bf6e | 9,726 | py | Python | mpf/devices/ball_lock.py | cloudjor/mpf | 1cf6bf18b0d81120383b0b128b0ebbfa1c62717c | [
"MIT"
] | null | null | null | mpf/devices/ball_lock.py | cloudjor/mpf | 1cf6bf18b0d81120383b0b128b0ebbfa1c62717c | [
"MIT"
] | null | null | null | mpf/devices/ball_lock.py | cloudjor/mpf | 1cf6bf18b0d81120383b0b128b0ebbfa1c62717c | [
"MIT"
] | null | null | null | """Contains the BallLock device class."""
import asyncio
from collections import deque
from mpf.core.events import event_handler
from mpf.core.device_monitor import DeviceMonitor
from mpf.core.mode_device import ModeDevice
from mpf.core.system_wide_device import SystemWideDevice
@DeviceMonitor("balls_locked", "enab... | 33.308219 | 115 | 0.609295 |
febe643c4d1cd47c8e0f1fe1c775b3cfa02bf215 | 15,777 | py | Python | src/frontend/flask_server.py | benjamin-maynard/bank-of-anthos | 337eb2dad5893aeb739c46d8f2ab8e2b80767b20 | [
"Apache-2.0"
] | null | null | null | src/frontend/flask_server.py | benjamin-maynard/bank-of-anthos | 337eb2dad5893aeb739c46d8f2ab8e2b80767b20 | [
"Apache-2.0"
] | null | null | null | src/frontend/flask_server.py | benjamin-maynard/bank-of-anthos | 337eb2dad5893aeb739c46d8f2ab8e2b80767b20 | [
"Apache-2.0"
] | null | null | null | '''
Copyright 2018 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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
di... | 36.605568 | 92 | 0.630094 |
570b5fb0f5aab5e919136f723628286783067959 | 23 | py | Python | lib/DataIO/__init__.py | atomrq/simulab | 886f2d613ecbac711b41026887f6d9f7ac94b25f | [
"BSD-3-Clause"
] | null | null | null | lib/DataIO/__init__.py | atomrq/simulab | 886f2d613ecbac711b41026887f6d9f7ac94b25f | [
"BSD-3-Clause"
] | null | null | null | lib/DataIO/__init__.py | atomrq/simulab | 886f2d613ecbac711b41026887f6d9f7ac94b25f | [
"BSD-3-Clause"
] | null | null | null | from .xml_io import *
| 11.5 | 22 | 0.695652 |
99fa30867471c13cb31f491dd431847a2bc375ea | 1,161 | py | Python | SIS/models.py | toHarsh/Management-System | 3ae86ca234c9d97c50d32c5378c24a6e189dfbb1 | [
"MIT"
] | 2 | 2021-01-03T00:36:50.000Z | 2021-03-20T19:35:04.000Z | SIS/models.py | toHarsh/sRecords | 3ae86ca234c9d97c50d32c5378c24a6e189dfbb1 | [
"MIT"
] | null | null | null | SIS/models.py | toHarsh/sRecords | 3ae86ca234c9d97c50d32c5378c24a6e189dfbb1 | [
"MIT"
] | null | null | null | from SIS import db,login_manager
from flask_login import UserMixin
# @app.before_first_request
# def create_tables():
# db.create_all()
@login_manager.user_loader
def get_user(user_id):
return Admin.query.get(int(user_id))
class Info(db.Model,UserMixin):
id = db.Column(db.Integer,primary_key=True)
ro... | 37.451613 | 125 | 0.694229 |
8e710962fb1ebcec099e723dc3308c2eab516d16 | 681 | py | Python | apps/project/models/credit.py | rainydaygit/testtcloudserver | 8037603efe4502726a4d794fb1fc0a3f3cc80137 | [
"MIT"
] | 349 | 2020-08-04T10:21:01.000Z | 2022-03-23T08:31:29.000Z | apps/project/models/credit.py | rainydaygit/testtcloudserver | 8037603efe4502726a4d794fb1fc0a3f3cc80137 | [
"MIT"
] | 2 | 2021-01-07T06:17:05.000Z | 2021-04-01T06:01:30.000Z | apps/project/models/credit.py | rainydaygit/testtcloudserver | 8037603efe4502726a4d794fb1fc0a3f3cc80137 | [
"MIT"
] | 70 | 2020-08-24T06:46:14.000Z | 2022-03-25T13:23:27.000Z | from library.api.db import db, EntityModel
class Credit(EntityModel):
ACTIVE = 0
DISABLE = 1
CREDIT_DATE = 33
CREDIT_SCORE_INIT = 100
CREDIT_ADD_ONCE = 1
CREDIT_SUB_ONCE = -1
user_id = db.Column(db.Integer) # 用户 id
score = db.Column(db.Integer, default=100) # 信用分
status = db.Col... | 26.192308 | 61 | 0.650514 |
f75c8620d862d82402e85ba5dbaecdc06f04bc2d | 12,068 | py | Python | input-files/desy_2021/INPUT_DESY-2021_Ti64_High_Temp_16alpha_4beta_iCSF_06.py | LightForm-group/continuous-peak-fit-analysis | e3133a016e64f45be6cb560d5cedc257bfe653a9 | [
"MIT"
] | null | null | null | input-files/desy_2021/INPUT_DESY-2021_Ti64_High_Temp_16alpha_4beta_iCSF_06.py | LightForm-group/continuous-peak-fit-analysis | e3133a016e64f45be6cb560d5cedc257bfe653a9 | [
"MIT"
] | null | null | null | input-files/desy_2021/INPUT_DESY-2021_Ti64_High_Temp_16alpha_4beta_iCSF_06.py | LightForm-group/continuous-peak-fit-analysis | e3133a016e64f45be6cb560d5cedc257bfe653a9 | [
"MIT"
] | null | null | null | # Input parameters for Ti64
# data drive.
import os
drive = "/mnt/iusers01/jf01/mbcx9cd4/rds_lightform/"
# properties of the data files.
datafile_directory = drive + 'SXRD_raw_data/desy_2021/diffraction_images/Def_04'
datafile_Basename = "Ti64_Rolled_ND_Compress_910C_1-00s-1_Multi-Hit_Temp_Cycl_4Cs-1_810_Cool_4Cs-1... | 33.337017 | 121 | 0.297812 |
56f149eb7708d98f1dbbb6b45cd60186b65e62bc | 1,145 | py | Python | rootfs/patcher-script.py | Cryptophobia/postgres | 48f9ac08d00a5ee0d61647027623c6f26fb325b9 | [
"MIT"
] | 2 | 2019-03-10T04:08:18.000Z | 2019-06-25T01:07:30.000Z | rootfs/patcher-script.py | Cryptophobia/postgres | 48f9ac08d00a5ee0d61647027623c6f26fb325b9 | [
"MIT"
] | 14 | 2018-04-04T17:46:56.000Z | 2020-10-10T18:07:23.000Z | rootfs/patcher-script.py | Cryptophobia/postgres | 48f9ac08d00a5ee0d61647027623c6f26fb325b9 | [
"MIT"
] | 6 | 2018-04-04T01:10:25.000Z | 2021-12-11T00:58:35.000Z | import sys
patch_script_tmp = """
def run_patch_scripts(patch_script_path):
with open(patch_script_path, 'r') as f:
try:
exec(f.read())
except:
pass
run_patch_scripts("%s")
"""
def main(patch_file, patch_script_file):
result_list = []
patch_script = patch_script_... | 27.261905 | 71 | 0.60786 |
f9958b1e24c8825c43835f26deeed5d062fa8ede | 8,032 | py | Python | gmn/src/d1_gmn/app/urls.py | DataONEorg/d1_python | dfab267c3adea913ab0e0073ed9dc1ee50b5b8eb | [
"Apache-2.0"
] | 15 | 2016-10-28T13:56:52.000Z | 2022-01-31T19:07:49.000Z | gmn/src/d1_gmn/app/urls.py | DataONEorg/d1_python | dfab267c3adea913ab0e0073ed9dc1ee50b5b8eb | [
"Apache-2.0"
] | 56 | 2017-03-16T03:52:32.000Z | 2022-03-12T01:05:28.000Z | gmn/src/d1_gmn/app/urls.py | DataONEorg/d1_python | dfab267c3adea913ab0e0073ed9dc1ee50b5b8eb | [
"Apache-2.0"
] | 11 | 2016-05-31T16:22:02.000Z | 2020-10-05T14:37:10.000Z | # This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2019 DataONE
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you ma... | 34.472103 | 82 | 0.616907 |
7d94d4eb95863bae878273b8d0d337d0b52f3306 | 88 | py | Python | src/micropython.py | ev3dev/micropython-linux | 6586ccdc0db16be0ffc5da459dcff3a7022e62bc | [
"MIT"
] | null | null | null | src/micropython.py | ev3dev/micropython-linux | 6586ccdc0db16be0ffc5da459dcff3a7022e62bc | [
"MIT"
] | null | null | null | src/micropython.py | ev3dev/micropython-linux | 6586ccdc0db16be0ffc5da459dcff3a7022e62bc | [
"MIT"
] | null | null | null | """Placeholder for MicroPython micropython module"""
def const(expr):
return expr
| 14.666667 | 52 | 0.727273 |
a7d26a3e578bbdd3f89e9cf7233b810c908f5b7e | 32,819 | py | Python | mjmech/video-ui/gbulb/selector_events.py | 2vin2vin/nslquad | 26a4397347bb7b92e06814e94fdd6d305dd2ebed | [
"Apache-2.0"
] | 64 | 2017-01-18T15:12:05.000Z | 2022-02-16T08:28:11.000Z | mjmech/video-ui/gbulb/selector_events.py | 2vin2vin/nslquad | 26a4397347bb7b92e06814e94fdd6d305dd2ebed | [
"Apache-2.0"
] | null | null | null | mjmech/video-ui/gbulb/selector_events.py | 2vin2vin/nslquad | 26a4397347bb7b92e06814e94fdd6d305dd2ebed | [
"Apache-2.0"
] | 10 | 2017-03-22T16:17:24.000Z | 2021-12-28T10:23:21.000Z | """Event loop using a selector and related classes.
A selector is a "notify-when-ready" multiplexer. For a subclass which
also includes support for signal handling, see the unix_events sub-module.
"""
__all__ = ['BaseSelectorEventLoop']
import collections
import errno
import socket
try:
import ssl
except Import... | 36.025247 | 81 | 0.573022 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.