hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 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 239 | max_issues_repo_name stringlengths 5 130 | 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 239 | max_forks_repo_name stringlengths 5 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 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
79544e8236b19db6b0a905707350074ea5a84957 | 3,936 | py | Python | pst-parser/pstformatters.py | stavinski/pst-parser | d542fe338caa1d19a77d48308abea59a0dd80576 | [
"MIT"
] | 3 | 2019-11-06T23:22:03.000Z | 2021-03-15T21:42:34.000Z | pst-parser/pstformatters.py | stavinski/pst-parser | d542fe338caa1d19a77d48308abea59a0dd80576 | [
"MIT"
] | 2 | 2017-05-02T08:19:33.000Z | 2017-05-04T12:15:06.000Z | pst-parser/pstformatters.py | stavinski/pst-parser | d542fe338caa1d19a77d48308abea59a0dd80576 | [
"MIT"
] | null | null | null |
import csv
import sys
# registry of formatters filled when subclasses are created
formatters = {}
def available_formatters():
return formatters.keys()
def from_name(name="screen", output=sys.stdout, args=None):
"""
Helper function to create correct formatter based on type passed
Args:
- na... | 30.75 | 108 | 0.607978 |
79544e8906f7c735e6b8bcc9ae69db560a1bb415 | 4,162 | py | Python | src/aryule.py | vishalbelsare/parametric_modeling | 9bfe5df35671930043215c8f6c855af8f49e28bf | [
"BSD-3-Clause"
] | 37 | 2015-02-01T12:03:48.000Z | 2021-12-23T14:38:38.000Z | src/aryule.py | vishalbelsare/parametric_modeling | 9bfe5df35671930043215c8f6c855af8f49e28bf | [
"BSD-3-Clause"
] | 2 | 2015-07-27T11:34:24.000Z | 2019-12-11T13:39:18.000Z | src/aryule.py | vishalbelsare/parametric_modeling | 9bfe5df35671930043215c8f6c855af8f49e28bf | [
"BSD-3-Clause"
] | 19 | 2016-09-06T20:23:19.000Z | 2021-11-07T16:07:40.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Created on Jan 22 20:38 2014
@author: Sammy Pfeiffer
@email: sammypfeiffer@gmail.com
This file pretends to imitate the behaviour of the MATLAB function aryule
Using spectrum implementation:
http://thomas-cokelaer.info/software/spectrum/html/user/ref_param.html#spectrum.yu... | 40.019231 | 123 | 0.617972 |
79544eba54ebe1c56e3a007c39f9a1886b197d32 | 25,701 | py | Python | per_title_analysis/per_title_analysis.py | thomMar/per-title-analysis | f87ab1af65f429723df6c74ef22095a1882348e0 | [
"MIT"
] | null | null | null | per_title_analysis/per_title_analysis.py | thomMar/per-title-analysis | f87ab1af65f429723df6c74ef22095a1882348e0 | [
"MIT"
] | null | null | null | per_title_analysis/per_title_analysis.py | thomMar/per-title-analysis | f87ab1af65f429723df6c74ef22095a1882348e0 | [
"MIT"
] | 4 | 2018-08-31T08:41:40.000Z | 2020-05-21T09:04:09.000Z | # -*- coding: utf-8 -*-
#importation
from __future__ import division
from pylab import *
import sys
import os
import json
import datetime
import statistics
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from task_providers import Probe, CrfEncode, CbrEncode, Metric
class EncodingProfile(... | 43.340641 | 291 | 0.63196 |
79544f059d74b07d8db41f9744080b82352b18e7 | 6,392 | py | Python | contents/MyExperiment/Exp3_test/run_this.py | Feng-XiaoYue/Reinforcement-learning-with-tensorflow-master | 011594083410f9b2f8e16eb5deed26e730ed849e | [
"MIT"
] | null | null | null | contents/MyExperiment/Exp3_test/run_this.py | Feng-XiaoYue/Reinforcement-learning-with-tensorflow-master | 011594083410f9b2f8e16eb5deed26e730ed849e | [
"MIT"
] | null | null | null | contents/MyExperiment/Exp3_test/run_this.py | Feng-XiaoYue/Reinforcement-learning-with-tensorflow-master | 011594083410f9b2f8e16eb5deed26e730ed849e | [
"MIT"
] | null | null | null | from .cluster_env import Cluster
from .RL_brain import QLearningTable
import datetime
import numpy as np
import matplotlib.pyplot as plt
import pylab as pl
import random
import pandas as pd
import time
from pandas.testing import assert_frame_equal
def state_init():
init_state = pd.DataFrame(np.zeros(12*4).reshape(... | 35.314917 | 149 | 0.57525 |
79545033756f34edaa344527e0762a3514ed038a | 446 | py | Python | AlgorithmsComparison/Time.py | mahmoudShaheen/RandomCollegeProjects | 6bcede0ad8b09ac738d8f49e6fed6d2b7a111cfd | [
"MIT"
] | null | null | null | AlgorithmsComparison/Time.py | mahmoudShaheen/RandomCollegeProjects | 6bcede0ad8b09ac738d8f49e6fed6d2b7a111cfd | [
"MIT"
] | null | null | null | AlgorithmsComparison/Time.py | mahmoudShaheen/RandomCollegeProjects | 6bcede0ad8b09ac738d8f49e6fed6d2b7a111cfd | [
"MIT"
] | null | null | null | from insertion import insertion_sort
from merge import merge_sort
import random
import time
if __name__ == '__main__':
items=[random.randint(-50,100) for c in range (1000)]
items2 = items
start = time.time()
insertion_sort(items)
insertiontime = time.time()-start
print "Insertion Sort Time = "... | 24.777778 | 57 | 0.701794 |
79545034b7eb157c095c153d3aca72f2b70189ff | 4,427 | py | Python | gtimecalc/main_window.py | danpla/gtimecalc | 5f160a2d7c878db301c5d7e4e439a349949ec679 | [
"Zlib"
] | null | null | null | gtimecalc/main_window.py | danpla/gtimecalc | 5f160a2d7c878db301c5d7e4e439a349949ec679 | [
"Zlib"
] | null | null | null | gtimecalc/main_window.py | danpla/gtimecalc | 5f160a2d7c878db301c5d7e4e439a349949ec679 | [
"Zlib"
] | null | null | null |
from gettext import gettext as _
import struct
from gi.repository import Gtk, Gdk, Gio, GLib
from . import app_info
from .settings import settings
from .common import WIDGET_SPACING
from .calculator import Calculator
from .notebook import Notebook
_C_INT_MAX = 2 ** (struct.Struct('i').size * 8 - 1) - 1
class Mai... | 28.56129 | 74 | 0.609894 |
795450bd826ba6f14b9211ede68f06d2e6f78b44 | 11,746 | py | Python | scripts/prepro_labels_vizwiz.py | Yinan-Zhao/AoANet | f0070931e0121c473d9a36b66d4c85b090c47c85 | [
"MIT"
] | null | null | null | scripts/prepro_labels_vizwiz.py | Yinan-Zhao/AoANet | f0070931e0121c473d9a36b66d4c85b090c47c85 | [
"MIT"
] | null | null | null | scripts/prepro_labels_vizwiz.py | Yinan-Zhao/AoANet | f0070931e0121c473d9a36b66d4c85b090c47c85 | [
"MIT"
] | null | null | null | """
Preprocess a raw json dataset into hdf5/json files for use in data_loader.lua
Input: json file that has the form
[{ file_path: 'path/img.jpg', captions: ['a caption', ...] }, ...]
example element in this list would look like
{'captions': [u'A man with a red helmet on a small moped on a dirt road. ', u'Man riding a... | 40.926829 | 483 | 0.693002 |
7954516a71d606bef1c136ae7aa4dadc8bac0938 | 52,557 | py | Python | projects/DensePose/densepose/densepose_coco_evaluation.py | charliememory/detectron2 | a2a6220068e73c616ee4c84cb52ea023c0203fa0 | [
"Apache-2.0"
] | null | null | null | projects/DensePose/densepose/densepose_coco_evaluation.py | charliememory/detectron2 | a2a6220068e73c616ee4c84cb52ea023c0203fa0 | [
"Apache-2.0"
] | null | null | null | projects/DensePose/densepose/densepose_coco_evaluation.py | charliememory/detectron2 | a2a6220068e73c616ee4c84cb52ea023c0203fa0 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
# This is a modified version of cocoeval.py where we also have the densepose evaluation.
__author__ = "tsungyi"
import cop... | 43.94398 | 110 | 0.512206 |
79545221add94b78078f5e419af1cd5aa3a5676d | 1,501 | py | Python | gen_coverage_report.py | umarcor/uhdm-integration | 5f3e5092cc912bed131b4b6328eef5537fec30e7 | [
"Apache-2.0"
] | 19 | 2020-07-27T08:07:13.000Z | 2021-06-22T20:10:04.000Z | gen_coverage_report.py | umarcor/uhdm-integration | 5f3e5092cc912bed131b4b6328eef5537fec30e7 | [
"Apache-2.0"
] | 214 | 2021-06-23T09:30:10.000Z | 2022-02-23T15:15:48.000Z | gen_coverage_report.py | umarcor/uhdm-integration | 5f3e5092cc912bed131b4b6328eef5537fec30e7 | [
"Apache-2.0"
] | 4 | 2020-04-21T17:06:23.000Z | 2020-11-04T09:03:49.000Z | import argparse
parser = argparse.ArgumentParser(description="Generate HTML coverage report "
"for UHDM-Verilator frontend")
parser.add_argument('--verilator-uhdm', action='store', dest='verilator_report')
parser.add_argument('--output-file', action='store', dest='output_f... | 37.525 | 104 | 0.637575 |
7954529fc932041b1ad2e0f333e4bc6dec248b5a | 3,016 | py | Python | auto_dynamut2.py | automutation/Mutation-prediction-automation | a6a34925c6962d91d2dd92e3a59b09f09d2e3b05 | [
"AFL-1.1"
] | null | null | null | auto_dynamut2.py | automutation/Mutation-prediction-automation | a6a34925c6962d91d2dd92e3a59b09f09d2e3b05 | [
"AFL-1.1"
] | null | null | null | auto_dynamut2.py | automutation/Mutation-prediction-automation | a6a34925c6962d91d2dd92e3a59b09f09d2e3b05 | [
"AFL-1.1"
] | null | null | null | #!usr/bin/python3
import re
import mechanicalsoup as msp
import sys
import pandas as pd
import os
def runDynamut(pdbFile,mutationFile,fChain):
os.chdir("/home/ibab/automutation")
try:
chain = fChain
file1 = open(mutationFile,"r")
muts = file1.readlines()
file1.close()
muts = [x.strip() for x in muts]
ne... | 29.281553 | 85 | 0.651857 |
79545308c1ae02f449457df0d1ce175543a64c0e | 1,265 | py | Python | src/vak/timebins.py | yardencsGitHub/vak | 04da97b02ded5acccab437c2538d0a1ded3bef80 | [
"BSD-3-Clause"
] | 1 | 2021-04-27T01:22:38.000Z | 2021-04-27T01:22:38.000Z | src/vak/timebins.py | yardencsGitHub/vak | 04da97b02ded5acccab437c2538d0a1ded3bef80 | [
"BSD-3-Clause"
] | null | null | null | src/vak/timebins.py | yardencsGitHub/vak | 04da97b02ded5acccab437c2538d0a1ded3bef80 | [
"BSD-3-Clause"
] | null | null | null | """module for functions that deal with vector of times from a spectrogram,
i.e. where elements are the times at bin centers"""
import numpy as np
def timebin_dur_from_vec(time_bins, n_decimals_trunc=5):
"""compute duration of a time bin, given the
vector of time bin centers associated with a spectrogram
... | 34.189189 | 93 | 0.699605 |
7954532a5ef8fd1c8821aa027f9f95090399c26a | 1,547 | py | Python | test/test_er.py | chrisgarcia001/Crisis-Volunteer-Resource-Allocation | d181327d9f077aa40f817ec066bfc2324d1bf01b | [
"MIT"
] | null | null | null | test/test_er.py | chrisgarcia001/Crisis-Volunteer-Resource-Allocation | d181327d9f077aa40f817ec066bfc2324d1bf01b | [
"MIT"
] | null | null | null | test/test_er.py | chrisgarcia001/Crisis-Volunteer-Resource-Allocation | d181327d9f077aa40f817ec066bfc2324d1bf01b | [
"MIT"
] | null | null | null | from os import sys
sys.path.insert(0, '../src/')
from experiment_runner import *
param_path = './params/base.csv'
def mpp(matrix):
for row in matrix:
print(row)
#params = {'tasks per shift':3, 'shifts per day':2, 'days in horizon':3, 'min shifts off between tasks':1}
params = read_params(param_path, True)
dg =... | 22.42029 | 106 | 0.733032 |
795454e09b3fe8f1381cfa7b205ca865fb0f9cfc | 7,836 | py | Python | thrift/lib/py/util/TCppServerTestManagerTest.py | CacheboxInc/fbthrift | b894dd9192ea4684c0067c93bb2ba2b9547749ec | [
"Apache-2.0"
] | 1 | 2018-02-28T06:45:51.000Z | 2018-02-28T06:45:51.000Z | thrift/lib/py/util/TCppServerTestManagerTest.py | CacheboxInc/fbthrift | b894dd9192ea4684c0067c93bb2ba2b9547749ec | [
"Apache-2.0"
] | null | null | null | thrift/lib/py/util/TCppServerTestManagerTest.py | CacheboxInc/fbthrift | b894dd9192ea4684c0067c93bb2ba2b9547749ec | [
"Apache-2.0"
] | 1 | 2018-02-28T06:45:18.000Z | 2018-02-28T06:45:18.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import threading
import unittest
from thrift.Thrift import TApplicationException, TPriority
from thrift.protocol import THeaderProtocol
from thrift.transport import TSoc... | 34.218341 | 83 | 0.630296 |
7954561a6ce5860848524a92092e838a5ccdb560 | 917 | py | Python | ShowMetrics.py | axell-brendow/image-processing-work | bf683081e394891e6865214273a69ee0be6b09d8 | [
"MIT"
] | 1 | 2020-10-06T20:34:52.000Z | 2020-10-06T20:34:52.000Z | ShowMetrics.py | axell-brendow/image-processing-work | bf683081e394891e6865214273a69ee0be6b09d8 | [
"MIT"
] | null | null | null | ShowMetrics.py | axell-brendow/image-processing-work | bf683081e394891e6865214273a69ee0be6b09d8 | [
"MIT"
] | null | null | null | import tkinter as tk
class ShowMetrics:
def __init__(
self,
parent: tk.Tk,
executionTime,
FP,
FN,
TP,
TN,
TPR, # Sensitivity, hit rate, recall, or true positive rate
TNR, # Specificity or true negative rate
ACC, # Overall accuracy
... | 25.472222 | 87 | 0.584515 |
7954580b9effbd58bff968767a2bf7d1aae3595c | 341 | py | Python | portafolio/urls.py | JVacca12/FIRST | e3906209cae1198e1fbda4d00bc0a906e8294a69 | [
"MIT"
] | null | null | null | portafolio/urls.py | JVacca12/FIRST | e3906209cae1198e1fbda4d00bc0a906e8294a69 | [
"MIT"
] | null | null | null | portafolio/urls.py | JVacca12/FIRST | e3906209cae1198e1fbda4d00bc0a906e8294a69 | [
"MIT"
] | null | null | null | """Portafolio URLs."""
# Django
from django.urls import include, path
# Django REST Framework
from rest_framework.routers import DefaultRouter
# Views
from portafolio import views
router = DefaultRouter()
router.register(r'portafolio', views.PortafolioViewSet, basename='portafolio')
urlpatterns = [
path('', in... | 20.058824 | 78 | 0.762463 |
79545890d90ff4c65a20dd8275c6d792c3daa8fb | 374 | py | Python | torch_kalman/internals/repr.py | Suhwan-Dev/torch-kalman | f310c42e264d1642819e4c49a8b0212209a18a85 | [
"MIT"
] | null | null | null | torch_kalman/internals/repr.py | Suhwan-Dev/torch-kalman | f310c42e264d1642819e4c49a8b0212209a18a85 | [
"MIT"
] | null | null | null | torch_kalman/internals/repr.py | Suhwan-Dev/torch-kalman | f310c42e264d1642819e4c49a8b0212209a18a85 | [
"MIT"
] | null | null | null | from torch import Tensor
class NiceRepr:
_repr_attrs = None
def __repr__(self) -> str:
kwargs = []
for k in self._repr_attrs:
v = getattr(self, k)
if isinstance(v, Tensor):
v = v.size()
kwargs.append("{}={!r}".format(k, v))
return "{... | 24.933333 | 70 | 0.510695 |
795458e326508a3ef1e49b4b7506763e2e81e2ae | 9,473 | py | Python | qa/rpc-tests/maxuploadtarget.py | thoughtnetwork/thought | 7da757fbbf5c868b8b06aca57c8b3a1c82b1e0d2 | [
"MIT"
] | null | null | null | qa/rpc-tests/maxuploadtarget.py | thoughtnetwork/thought | 7da757fbbf5c868b8b06aca57c8b3a1c82b1e0d2 | [
"MIT"
] | 3 | 2019-10-16T15:33:36.000Z | 2021-07-28T00:38:37.000Z | qa/rpc-tests/maxuploadtarget.py | thoughtnetwork/thought | 7da757fbbf5c868b8b06aca57c8b3a1c82b1e0d2 | [
"MIT"
] | 1 | 2021-06-30T05:04:17.000Z | 2021-06-30T05:04:17.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2017-2021 Thought Networks, LLC
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.mininode import *
from test_framework... | 39.307054 | 173 | 0.667476 |
7954594b11ba795a93ec65933aebccda65653abb | 790 | py | Python | python/tempsensor/setup.py | lalajoie/g1-Security | 2657e7cc86eee1cc3bf302d288bedf54bbb5200b | [
"MIT"
] | null | null | null | python/tempsensor/setup.py | lalajoie/g1-Security | 2657e7cc86eee1cc3bf302d288bedf54bbb5200b | [
"MIT"
] | null | null | null | python/tempsensor/setup.py | lalajoie/g1-Security | 2657e7cc86eee1cc3bf302d288bedf54bbb5200b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import setuptools
with open('README.md', "r") as f:
readme = f.read()
setuptools.setup(
name="PyMLX90614",
description="MLX90614 temperature sensor library",
version="0.0.3",
author="Connor Kneebone",
author_email="connor@sfxrescue.com",
url="https://github.com/Conr8... | 29.259259 | 70 | 0.663291 |
795459d5c8f4095918358e36eba7329133afb4ac | 3,752 | py | Python | contrib/macdeploy/custom_dsstore.py | Daviel360/litecoin | 0301f78bb93763684c9b3b67724ba8af14cde37e | [
"MIT"
] | null | null | null | contrib/macdeploy/custom_dsstore.py | Daviel360/litecoin | 0301f78bb93763684c9b3b67724ba8af14cde37e | [
"MIT"
] | null | null | null | contrib/macdeploy/custom_dsstore.py | Daviel360/litecoin | 0301f78bb93763684c9b3b67724ba8af14cde37e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2013-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import biplist
from ds_store import DSStore
from mac_alias import Alias
import sys
output_file = sys.argv... | 62.533333 | 1,817 | 0.727345 |
795459f62e10926d736bec16eb7d375dbff9b817 | 48,822 | py | Python | guilded/ext/commands/help.py | ThomasJRyan/guilded.py | e1bb5cab839c80c851d4538111e4f1563bb15187 | [
"MIT"
] | 79 | 2020-09-19T22:48:04.000Z | 2022-03-25T03:49:26.000Z | guilded/ext/commands/help.py | ThomasJRyan/guilded.py | e1bb5cab839c80c851d4538111e4f1563bb15187 | [
"MIT"
] | 19 | 2020-09-07T21:54:42.000Z | 2022-02-08T05:08:05.000Z | guilded/ext/commands/help.py | ThomasJRyan/guilded.py | e1bb5cab839c80c851d4538111e4f1563bb15187 | [
"MIT"
] | 24 | 2020-09-05T16:28:42.000Z | 2022-03-16T02:31:10.000Z | """
MIT License
Copyright (c) 2020-present windowsboy111, shay (shayypy)
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,... | 36.137676 | 133 | 0.630228 |
79545bafbf7a82d975907af756fe6ae4d1b28375 | 271 | py | Python | openvisualizer/simulator/link.py | TimothyClaeys/openvisualizer | fd934a7ce2c4a15c66280882cd1a5cc4cc987d8c | [
"BSD-3-Clause"
] | null | null | null | openvisualizer/simulator/link.py | TimothyClaeys/openvisualizer | fd934a7ce2c4a15c66280882cd1a5cc4cc987d8c | [
"BSD-3-Clause"
] | 4 | 2020-05-06T14:51:09.000Z | 2020-05-25T11:42:28.000Z | openvisualizer/simulator/link.py | TimothyClaeys/openvisualizer | fd934a7ce2c4a15c66280882cd1a5cc4cc987d8c | [
"BSD-3-Clause"
] | 1 | 2020-12-01T07:58:52.000Z | 2020-12-01T07:58:52.000Z | from typing import TYPE_CHECKING
if TYPE_CHECKING:
from multiprocessing.queues import Queue
class Link:
""" Module that describes the link quality between two motes"""
def __init__(self, pdr: int, rx: 'Queue'):
self.pdr = pdr
self.rx = rx
| 20.846154 | 67 | 0.675277 |
79545c151ee82832320cdb61ed1ecabb82c73329 | 1,786 | py | Python | _unittests/ut_df/test_dataframe_helpers_simple.py | Pandinosaurus/pandas_streaming | 03008b63545e3634290ef0c041e920d94d454ccf | [
"MIT"
] | 20 | 2017-09-23T03:23:13.000Z | 2022-02-21T09:10:48.000Z | _unittests/ut_df/test_dataframe_helpers_simple.py | Pandinosaurus/pandas_streaming | 03008b63545e3634290ef0c041e920d94d454ccf | [
"MIT"
] | 19 | 2017-09-24T17:10:39.000Z | 2021-12-29T11:02:58.000Z | _unittests/ut_df/test_dataframe_helpers_simple.py | Pandinosaurus/pandas_streaming | 03008b63545e3634290ef0c041e920d94d454ccf | [
"MIT"
] | 7 | 2018-11-09T08:15:20.000Z | 2021-09-17T07:39:44.000Z | # -*- coding: utf-8 -*-
"""
@brief test log(time=4s)
"""
import unittest
import pandas
import numpy
from pyquickhelper.pycode import ExtTestCase
from pandas_streaming.df import dataframe_unfold
from pandas_streaming.df.dataframe_helpers import hash_int, hash_str, hash_float
class TestDataFrameHelpersSimple(ExtTe... | 33.074074 | 90 | 0.553751 |
79545c51506d256eebead2a69e5dce132987671c | 5,951 | py | Python | docs/conf.py | SlicerProstate/SlicerPIRADS | b160dc547a955f2d20f52b7247d39d4de21eaa8e | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | SlicerProstate/SlicerPIRADS | b160dc547a955f2d20f52b7247d39d4de21eaa8e | [
"BSD-3-Clause"
] | 8 | 2018-03-19T14:18:15.000Z | 2018-08-02T20:45:15.000Z | docs/conf.py | SlicerProstate/SlicerPIRADS | b160dc547a955f2d20f52b7247d39d4de21eaa8e | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | 31.321053 | 112 | 0.658713 |
79545df342f8d31fe948ee54ee86bbfe38a41753 | 307 | py | Python | test/run_all_tests.py | dchampion/crypto | 1d48e84fd14bbb489c53296e145c1dee10c4d39c | [
"MIT"
] | null | null | null | test/run_all_tests.py | dchampion/crypto | 1d48e84fd14bbb489c53296e145c1dee10c4d39c | [
"MIT"
] | null | null | null | test/run_all_tests.py | dchampion/crypto | 1d48e84fd14bbb489c53296e145c1dee10c4d39c | [
"MIT"
] | null | null | null | import dh_test
import euclid_test
import primes_test
import rsa_test
import util_test
def main():
print("Running all tests...")
dh_test.main()
euclid_test.main()
primes_test.main()
rsa_test.main()
util_test.main()
print("all tests passed")
if __name__ == "__main__":
main() | 18.058824 | 33 | 0.684039 |
79545f4e0b96697e4cb43fc7ad9e993e39ab3078 | 439 | py | Python | tools/remoteaccess/tests/03-read.py | zxpower/MansOS | 1130f54357649eb25020951951d9a5963e755c66 | [
"MIT"
] | 10 | 2015-10-14T12:35:50.000Z | 2022-02-20T12:24:36.000Z | tools/remoteaccess/tests/03-read.py | zxpower/MansOS | 1130f54357649eb25020951951d9a5963e755c66 | [
"MIT"
] | 13 | 2015-11-24T03:25:08.000Z | 2017-02-08T09:15:45.000Z | tools/remoteaccess/tests/03-read.py | zxpower/MansOS | 1130f54357649eb25020951951d9a5963e755c66 | [
"MIT"
] | 7 | 2015-10-15T07:53:52.000Z | 2020-12-15T00:15:49.000Z | #!/usr/bin/env python
# Get data
import os, sys, time
import urllib2
def main():
host = "http://localhost:30001/read?port=/dev/ttyUSB0"
# host = "http://10.0.0.1:30001/read?port=/dev/ttyUSB0"
try:
req = urllib2.urlopen(host)
print("Reply data:")
print(req.read())
except Excepti... | 19.954545 | 58 | 0.587699 |
79545fcc9e9aac696bc8f6fc6290c65301ce3933 | 91,085 | py | Python | Ninja/leetcode.py | cyandterry/Python-Study | b40e6c4db10da417e72247f61146f7570621106a | [
"MIT"
] | 61 | 2015-02-03T20:25:55.000Z | 2021-05-17T19:33:40.000Z | Ninja/leetcode.py | cyandterry/Python-Study | b40e6c4db10da417e72247f61146f7570621106a | [
"MIT"
] | null | null | null | Ninja/leetcode.py | cyandterry/Python-Study | b40e6c4db10da417e72247f61146f7570621106a | [
"MIT"
] | 37 | 2015-02-04T07:12:52.000Z | 2020-05-16T18:47:16.000Z | #!/usr/bin/env python
# 1.Single Number
# Fuck!!! use XOR
def single_number(num_list):
for num in num_list[1:]
if num is not None:
num_list[0] ^= num
return num_list[0]
# 2. Maximum depth of binary tree
def maximum_depth(root):
if root is None:
return 0
return max( maximum_... | 26.640831 | 122 | 0.537223 |
795460823556b9e43ad6d9c18d3cacbc2ce2910c | 2,578 | py | Python | scriptabit/tests/test_habitica_task.py | luqiang21/scriptabit | 0d0cf71814e98954850891fa0887bdcffcf7147d | [
"Apache-2.0"
] | 9 | 2016-09-04T07:02:20.000Z | 2021-06-29T07:29:40.000Z | scriptabit/tests/test_habitica_task.py | luqiang21/scriptabit | 0d0cf71814e98954850891fa0887bdcffcf7147d | [
"Apache-2.0"
] | 35 | 2016-07-30T01:03:15.000Z | 2022-02-12T20:27:37.000Z | scriptabit/tests/test_habitica_task.py | luqiang21/scriptabit | 0d0cf71814e98954850891fa0887bdcffcf7147d | [
"Apache-2.0"
] | 8 | 2016-09-05T12:36:53.000Z | 2020-06-15T18:25:50.000Z | # -*- coding: utf-8 -*-
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals,
)
from builtins import *
import json
import pytest
import requests
import requests_mock
from pkg_resources import resource_filename
from scriptabit import (
HabiticaTask,
Difficulty,
... | 26.040404 | 84 | 0.700543 |
7954612c88950b2acfc08cb70c7ff7a825db9c09 | 6,412 | py | Python | slowfast/visualization/predictor.py | Romero027/SlowFast | f4308eb1c46d88c3a41a6fb2d1fd4fad56fdd43a | [
"Apache-2.0"
] | null | null | null | slowfast/visualization/predictor.py | Romero027/SlowFast | f4308eb1c46d88c3a41a6fb2d1fd4fad56fdd43a | [
"Apache-2.0"
] | null | null | null | slowfast/visualization/predictor.py | Romero027/SlowFast | f4308eb1c46d88c3a41a6fb2d1fd4fad56fdd43a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import cv2
import torch
from detectron2 import model_zoo
from detectron2.config import get_cfg
from detectron2.engine import DefaultPredictor
import slowfast.utils.checkpoint as cu
from slowfast.datasets import cv2_transfor... | 33.051546 | 85 | 0.602308 |
79546139a51fc660c1a7b9f6a67b633a24bdf577 | 938 | py | Python | var/spack/repos/builtin/packages/meshtool/package.py | kotfic/spack | 181ac574bb14f1d31910c421a419cc3866f0bce9 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/meshtool/package.py | kotfic/spack | 181ac574bb14f1d31910c421a419cc3866f0bce9 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/meshtool/package.py | kotfic/spack | 181ac574bb14f1d31910c421a419cc3866f0bce9 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class Meshtool(MakefilePackage):
"""Meshtool - A mesh manipulation utility"""
homep... | 34.740741 | 73 | 0.727079 |
7954620ffeeda58ad2f05c0ec16a386e57e50abc | 532 | py | Python | tests/util/db_connection.py | zcomputerwiz/shamrock-blockchain | 2e2d8a134f0147379812085543ac98f37ce28c2b | [
"Apache-2.0"
] | null | null | null | tests/util/db_connection.py | zcomputerwiz/shamrock-blockchain | 2e2d8a134f0147379812085543ac98f37ce28c2b | [
"Apache-2.0"
] | null | null | null | tests/util/db_connection.py | zcomputerwiz/shamrock-blockchain | 2e2d8a134f0147379812085543ac98f37ce28c2b | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
from shamrock.util.db_wrapper import DBWrapper
import tempfile
import aiosqlite
class DBConnection:
async def __aenter__(self) -> DBWrapper:
self.db_path = Path(tempfile.NamedTemporaryFile().name)
if self.db_path.exists():
self.db_path.unlink()
self.con... | 29.555556 | 63 | 0.701128 |
7954626ad26aaad60a35b3f497e787dfdd30c578 | 684 | py | Python | OOP5.py | PRASAD-DANGARE/PYTHON | 36214f7dc3762d327e5a29e40752edeb098249c8 | [
"MIT"
] | 1 | 2021-06-07T07:55:28.000Z | 2021-06-07T07:55:28.000Z | OOP5.py | PRASAD-DANGARE/PYTHON | 36214f7dc3762d327e5a29e40752edeb098249c8 | [
"MIT"
] | null | null | null | OOP5.py | PRASAD-DANGARE/PYTHON | 36214f7dc3762d327e5a29e40752edeb098249c8 | [
"MIT"
] | null | null | null | '''
Description : Demonstration of Characteristics of Class
Function Date : 04 Mar 2021
Function Author : Prasad Dangare
'''
print("Demonstration of Characteristics of Class")
class Demo: # Class Defination
x = 50 # Class Variable
def __init__(self,no1,no2): # Class Costructor
... | 23.586207 | 87 | 0.660819 |
795462742d21d693970272a4df23c195145ff422 | 2,452 | py | Python | var/spack/repos/builtin/packages/proj/package.py | msimberg/spack | 27a339eeb28007bf0844e4c331bdd7d9da13da2e | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/proj/package.py | msimberg/spack | 27a339eeb28007bf0844e4c331bdd7d9da13da2e | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/proj/package.py | msimberg/spack | 27a339eeb28007bf0844e4c331bdd7d9da13da2e | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Proj(AutotoolsPackage):
"""PROJ is a generic coordinate transformation software, that tran... | 48.078431 | 95 | 0.748777 |
7954631ebc425d6b4034b6313f7deb3c29d19dd9 | 6,428 | py | Python | kubernetes/client/models/v1alpha1_role.py | amanagarwal33/python | e31693557f75950805fb4dc5af4cb7434a470e26 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1alpha1_role.py | amanagarwal33/python | e31693557f75950805fb4dc5af4cb7434a470e26 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1alpha1_role.py | amanagarwal33/python | e31693557f75950805fb4dc5af4cb7434a470e26 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
<<<<<<< HEAD
OpenAPI spec version: v1.15.6
Generated by: https://openapi-generator.tech
=======
OpenAPI spec version: v1.5.3
Generated b... | 31.665025 | 295 | 0.609365 |
795463357272c02290426801460f72f08f43a72f | 5,621 | py | Python | isolyzer/apple.py | KBNLresearch/isolyzer | 07f74991bd22b7f21b5f7e6af3625dfb4cb28ced | [
"Apache-2.0"
] | 19 | 2017-05-02T03:43:28.000Z | 2022-02-09T22:22:33.000Z | isolyzer/apple.py | KBNLresearch/isolyzer | 07f74991bd22b7f21b5f7e6af3625dfb4cb28ced | [
"Apache-2.0"
] | 19 | 2017-04-19T13:55:06.000Z | 2022-03-09T01:33:54.000Z | isolyzer/apple.py | KBNLresearch/isolyzer | 07f74991bd22b7f21b5f7e6af3625dfb4cb28ced | [
"Apache-2.0"
] | 5 | 2017-06-04T15:39:02.000Z | 2022-03-04T22:19:37.000Z | #! /usr/bin/env python
"""Parser functions for Apple file systems"""
import xml.etree.ElementTree as ET
from . import byteconv as bc
from . import shared as shared
def parseZeroBlock(bytesData):
"""Parse Zero Block and return extracted properties"""
# Based on code at:
# https://opensource.apple.com/so... | 41.637037 | 116 | 0.66127 |
79546409653190e33990a9a45bfe0a7a0fd31a11 | 552 | py | Python | melon/wallet/derivation_record.py | ninroi/Rio | 123ea10ec1643203efbac61f401f5db58d11466b | [
"Apache-2.0"
] | 4 | 2021-12-05T11:36:17.000Z | 2022-02-19T09:30:02.000Z | melon/wallet/derivation_record.py | ninroi/Rio | 123ea10ec1643203efbac61f401f5db58d11466b | [
"Apache-2.0"
] | 15 | 2021-11-02T12:14:25.000Z | 2022-03-29T12:14:36.000Z | melon/wallet/derivation_record.py | ninroi/Rio | 123ea10ec1643203efbac61f401f5db58d11466b | [
"Apache-2.0"
] | 4 | 2021-11-21T02:11:34.000Z | 2022-03-15T08:37:47.000Z | from dataclasses import dataclass
from blspy import G1Element
from melon.types.blockchain_format.sized_bytes import bytes32
from melon.util.ints import uint32
from melon.wallet.util.wallet_types import WalletType
@dataclass(frozen=True)
class DerivationRecord:
"""
These are records representing a puzzle has... | 25.090909 | 78 | 0.768116 |
795464d0b4f16fb700bdd2ccf3ad18ce080a7195 | 9,418 | py | Python | thirdparty/stylegan3_ops/ops/bias_act.py | STomoya/animeface | 37b3cd26097d7874559d4c152e41e5712b7a1a42 | [
"MIT"
] | 61 | 2020-06-06T08:25:09.000Z | 2022-03-28T13:30:10.000Z | thirdparty/stylegan3_ops/ops/bias_act.py | OrigamiXx/animeface | 8724006df99ba7ef369e837d8294350ea733611b | [
"MIT"
] | 13 | 2020-07-02T02:41:14.000Z | 2021-05-09T14:24:58.000Z | thirdparty/stylegan3_ops/ops/bias_act.py | OrigamiXx/animeface | 8724006df99ba7ef369e837d8294350ea733611b | [
"MIT"
] | 8 | 2020-10-03T18:51:16.000Z | 2022-02-05T18:18:01.000Z | # Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
"""Custom PyTorch ops for efficient bias and activation."""
import os
import numpy as np
import torch
# import dnnlib
from utils import EasyDict
from .. import custom_ops
from .. import misc
#----------------------------------------------... | 45.941463 | 178 | 0.568061 |
795464e94c2f799c9fde2deae9ce33cbec59e935 | 5,967 | py | Python | napari_ndtiffs/reader.py | neuromusic/napari-ndtiffs | 7e89e5b2e5291631daf4e962d43e51757a2b1797 | [
"BSD-3-Clause"
] | 7 | 2020-06-18T19:42:17.000Z | 2022-01-06T02:20:53.000Z | napari_ndtiffs/reader.py | neuromusic/napari-ndtiffs | 7e89e5b2e5291631daf4e962d43e51757a2b1797 | [
"BSD-3-Clause"
] | 6 | 2020-09-10T17:15:18.000Z | 2022-01-20T21:22:45.000Z | napari_ndtiffs/reader.py | neuromusic/napari-ndtiffs | 7e89e5b2e5291631daf4e962d43e51757a2b1797 | [
"BSD-3-Clause"
] | 3 | 2020-09-10T17:21:18.000Z | 2021-12-21T03:28:34.000Z | """Plugin to read lattice light sheet folders into napari."""
import glob
import logging
import os
import re
import zipfile
from contextlib import contextmanager
from typing import Any, Callable, Dict, List, Tuple, Union
import numpy as np
from dask import array as da
from dask import delayed
from tifffile import Tiff... | 30.443878 | 88 | 0.597285 |
7954656b8354d0dffe0e7b179719c763c42b14da | 5,850 | py | Python | tests/test_heartbeat.py | Anton-Latukha/wakatime | 3035a28a3f996a11d928802dcb05844bb0a52655 | [
"BSD-3-Clause"
] | 1 | 2021-05-13T21:13:27.000Z | 2021-05-13T21:13:27.000Z | tests/test_heartbeat.py | Anton-Latukha/wakatime | 3035a28a3f996a11d928802dcb05844bb0a52655 | [
"BSD-3-Clause"
] | null | null | null | tests/test_heartbeat.py | Anton-Latukha/wakatime | 3035a28a3f996a11d928802dcb05844bb0a52655 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from wakatime.heartbeat import Heartbeat
import os
import logging
from testfixtures import log_capture
from .utils import DynamicIterable, TestCase, mock
class HeartbeatTestCase(TestCase):
@log_capture()
def test_sanitize_removes_sensitive_data(self, logs):
logging.disable(... | 30.952381 | 118 | 0.558974 |
7954662bac0624b2208f69bb3698d0b379b4f28a | 4,267 | py | Python | leetcode_python/Math/roman-to-integer.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Math/roman-to-integer.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Math/roman-to-integer.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | """
13. Roman to Integer
Easy
Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.
Symbol Value
I 1
V 5
X 10
L 50
C 100
D 500
M 1000
For example, 2 is written as II in Roman numeral, just two one's... | 27.352564 | 345 | 0.494727 |
79546738b7fe4f0e154bb33a04dceae5f50a7c1b | 1,816 | py | Python | rankers/MinRanker/tests/test_minranker.py | carlosb1/jina-hub | f298d0f136c8627dd720d7a4e3eb9031655f5ccb | [
"Apache-2.0"
] | 1 | 2022-03-01T12:43:17.000Z | 2022-03-01T12:43:17.000Z | rankers/MinRanker/tests/test_minranker.py | carlosb1/jina-hub | f298d0f136c8627dd720d7a4e3eb9031655f5ccb | [
"Apache-2.0"
] | null | null | null | rankers/MinRanker/tests/test_minranker.py | carlosb1/jina-hub | f298d0f136c8627dd720d7a4e3eb9031655f5ccb | [
"Apache-2.0"
] | null | null | null | import numpy as np
from jina.executors.rankers import Chunk2DocRanker
from .. import MinRanker
def create_data():
query_chunk2match_chunk = {
100: [
{'parent_id': 1, 'id': 10, 'score': 0.4, 'length': 200},
],
110: [
{'parent_id': 1, 'id': 10, 'score': 0.3, 'length... | 31.310345 | 77 | 0.589207 |
7954676a7f4080046cb014f598c4d4d80268316f | 5,468 | py | Python | DartMuscle/muscle.py | hpgit/HumanFoot | f9a1a341b7c43747bddcd5584b8c98a0d1ac2973 | [
"Apache-2.0"
] | null | null | null | DartMuscle/muscle.py | hpgit/HumanFoot | f9a1a341b7c43747bddcd5584b8c98a0d1ac2973 | [
"Apache-2.0"
] | null | null | null | DartMuscle/muscle.py | hpgit/HumanFoot | f9a1a341b7c43747bddcd5584b8c98a0d1ac2973 | [
"Apache-2.0"
] | null | null | null | from math import exp, sin, cos, asin, pi, sqrt
from scipy.optimize import minimize_scalar
# muscle specific parameters
f_m_o, l_m_o, l_t_sl, alpha_opt = 0, 0, 0, 0
# all muslces share these parameters
eps_t_o = 0.033
eps_m_o = 0.6
k_pe = 4.0
gamma = 0.5
dot_l_m_max_tilde = 10.
f_m_len_tilde = 1.8
A_f = 0.3
# Force-L... | 28.778947 | 114 | 0.604426 |
795468c51f7208813c6000e19243e56b0e75dc2b | 8,159 | py | Python | targetApproach.py | BenjiLee0002/TheUglyDuckling | 13a4bf3307ac5959a7ceb32122a53b91bec2b7f3 | [
"MIT"
] | 4 | 2019-09-25T17:44:07.000Z | 2021-11-03T15:34:19.000Z | targetApproach.py | RishavRajendra/TheUglyDuckling | 1726dd1d4b5c35e4e2b421a8652133724100fffd | [
"MIT"
] | null | null | null | targetApproach.py | RishavRajendra/TheUglyDuckling | 1726dd1d4b5c35e4e2b421a8652133724100fffd | [
"MIT"
] | 1 | 2019-11-22T14:53:17.000Z | 2019-11-22T14:53:17.000Z | from get_stats_from_image import corrected_angle, get_closest_target
from constants import fwd, rev
import time, math
# DONE: Check if the block is actually picked up
def check_pick_up(movement, pic_q):
success = False
movement.cam_down()
time.sleep(3)
target_id, angle, inches, midpoint = get_closest_t... | 39.225962 | 101 | 0.606937 |
795469960aecdbbb44cae22674d64b053bd39746 | 85 | py | Python | threatbutt/__init__.py | ivanlei/threatbutt | faff507a4bebfa585d3044427111418c257c34ec | [
"Apache-2.0"
] | 55 | 2015-04-25T07:22:18.000Z | 2021-05-23T15:04:52.000Z | threatbutt/__init__.py | ivanlei/threatbutt | faff507a4bebfa585d3044427111418c257c34ec | [
"Apache-2.0"
] | null | null | null | threatbutt/__init__.py | ivanlei/threatbutt | faff507a4bebfa585d3044427111418c257c34ec | [
"Apache-2.0"
] | 8 | 2015-04-27T03:51:49.000Z | 2021-04-28T22:17:18.000Z | # -*- coding: utf-8 -*-
from .threatbutt import ThreatButt
__all__ = ['ThreatButt']
| 17 | 34 | 0.670588 |
79546aa0b4fdb7803f31d7386c0d88c52ff6efe1 | 16,191 | py | Python | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/credit/api/eligibility.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | 3 | 2021-12-15T04:58:18.000Z | 2022-02-06T12:15:37.000Z | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/credit/api/eligibility.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | null | null | null | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/credit/api/eligibility.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | 1 | 2019-01-02T14:38:50.000Z | 2019-01-02T14:38:50.000Z | """
APIs for configuring credit eligibility requirements and tracking
whether a user has satisfied those requirements.
"""
import logging
from opaque_keys.edx.keys import CourseKey
from common.djangoapps.course_modes.models import CourseMode
from openedx.core.djangoapps.credit.email_utils import send_credit_notific... | 36.881549 | 120 | 0.6293 |
79546b27853b436a4e474d9be42a32f74248b522 | 15,802 | py | Python | tests/apps/courses/test_cms_wizards_category.py | openfun/richie | 185b2be74ce75de8de1da159773afc43e365df3e | [
"MIT"
] | 174 | 2018-04-14T23:36:01.000Z | 2022-03-10T09:27:01.000Z | tests/apps/courses/test_cms_wizards_category.py | EDUlib/richie | 3f9b14b929641f9392e54ba9badbb7a9a9fe7d44 | [
"MIT"
] | 631 | 2018-04-04T11:28:53.000Z | 2022-03-31T11:18:31.000Z | tests/apps/courses/test_cms_wizards_category.py | EDUlib/richie | 3f9b14b929641f9392e54ba9badbb7a9a9fe7d44 | [
"MIT"
] | 64 | 2018-06-27T08:35:01.000Z | 2022-03-10T09:27:43.000Z | """
Test suite for the wizard creating a new Category page
"""
from django.core.exceptions import PermissionDenied
from django.urls import reverse
from cms.api import Page, create_page
from cms.test_utils.testcases import CMSTestCase
from richie.apps.core.factories import UserFactory
from richie.apps.courses.cms_wiza... | 38.447689 | 99 | 0.614416 |
79546b4038a0189a4b01d776e87766c44acc4791 | 1,479 | py | Python | samples/interactive-tutorials/events/import_user_events_inline_test.py | tetiana-karasova/python-retail | b834c1fb16212e59241267e18d38b490e962af7f | [
"Apache-2.0"
] | 1 | 2022-02-11T14:00:31.000Z | 2022-02-11T14:00:31.000Z | samples/interactive-tutorials/events/import_user_events_inline_test.py | tetiana-karasova/python-retail | b834c1fb16212e59241267e18d38b490e962af7f | [
"Apache-2.0"
] | null | null | null | samples/interactive-tutorials/events/import_user_events_inline_test.py | tetiana-karasova/python-retail | b834c1fb16212e59241267e18d38b490e962af7f | [
"Apache-2.0"
] | 2 | 2022-01-28T09:53:16.000Z | 2022-02-07T14:27:38.000Z | # Copyright 2022 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 ... | 37.923077 | 127 | 0.709263 |
79546b9f73613f57d4634ebe00f96e4354b83837 | 1,057 | py | Python | app/models.py | afexer/apache-gunicorn-flask-socketio | 8d7a1c9475ea7f3f1955d38f5c529a9e23215771 | [
"MIT"
] | null | null | null | app/models.py | afexer/apache-gunicorn-flask-socketio | 8d7a1c9475ea7f3f1955d38f5c529a9e23215771 | [
"MIT"
] | 2 | 2020-07-24T17:06:43.000Z | 2020-07-24T17:14:32.000Z | app/models.py | afexer/apache-gunicorn-flask-socketio | 8d7a1c9475ea7f3f1955d38f5c529a9e23215771 | [
"MIT"
] | null | null | null | from werkzeug.security import generate_password_hash, check_password_hash
from app.db import db
from app.lm import lm
from flask_login import UserMixin
class User(UserMixin, db.Model):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(16), index=True, uniq... | 27.815789 | 73 | 0.701987 |
79546bfc7c23df57df635164b95e736d5f13352f | 3,817 | py | Python | paradigm/Selection.py | Paradigm-shift-AI/paradigm-brain | 5347a91dbb45b1352534a256968ce7f6ff6bb299 | [
"MIT"
] | null | null | null | paradigm/Selection.py | Paradigm-shift-AI/paradigm-brain | 5347a91dbb45b1352534a256968ce7f6ff6bb299 | [
"MIT"
] | null | null | null | paradigm/Selection.py | Paradigm-shift-AI/paradigm-brain | 5347a91dbb45b1352534a256968ce7f6ff6bb299 | [
"MIT"
] | null | null | null | import random
import operator
class Selection:
def __init__(self, preprocessed_question, list_of_questions, token=False):
"""
list_of_questions:
[
questionTypeID: [<question_object>],
]
"""
self.preprocessed_question = preprocessed_question
self... | 35.672897 | 98 | 0.496987 |
79546c901c98e841b7e09d9cf97c8e91beff8656 | 22,768 | py | Python | tests/safety/common.py | L-Net-1992/panda | e6c2b0ff01ea4eca283ea7c850e44675edcdebdf | [
"MIT"
] | null | null | null | tests/safety/common.py | L-Net-1992/panda | e6c2b0ff01ea4eca283ea7c850e44675edcdebdf | [
"MIT"
] | null | null | null | tests/safety/common.py | L-Net-1992/panda | e6c2b0ff01ea4eca283ea7c850e44675edcdebdf | [
"MIT"
] | null | null | null | import os
import abc
import unittest
import importlib
import numpy as np
from collections import defaultdict
from typing import Optional, List, Dict
from opendbc.can.packer import CANPacker # pylint: disable=import-error
from panda import ALTERNATIVE_EXPERIENCE, LEN_TO_DLC
from panda.tests.safety import libpandasafet... | 38.329966 | 126 | 0.719694 |
79546d810875686045146318d03c82890be863e2 | 13,024 | py | Python | polyfuzz/polyfuzz.py | darkravager/PolyFuzz | 05485dcd81f60cfe2eb2538a72b96b62405170b2 | [
"MIT"
] | 445 | 2020-11-28T07:49:00.000Z | 2022-03-27T17:54:50.000Z | polyfuzz/polyfuzz.py | darkravager/PolyFuzz | 05485dcd81f60cfe2eb2538a72b96b62405170b2 | [
"MIT"
] | 24 | 2020-12-06T19:16:18.000Z | 2022-03-29T09:51:38.000Z | polyfuzz/polyfuzz.py | darkravager/PolyFuzz | 05485dcd81f60cfe2eb2538a72b96b62405170b2 | [
"MIT"
] | 42 | 2020-12-01T06:33:07.000Z | 2022-02-27T16:02:54.000Z | import logging
import pandas as pd
from typing import List, Mapping, Union, Iterable
from polyfuzz.linkage import single_linkage
from polyfuzz.utils import check_matches, check_grouped, create_logger
from polyfuzz.models import TFIDF, RapidFuzz, Embeddings, BaseMatcher
from polyfuzz.metrics import precision_recall_cur... | 39.347432 | 114 | 0.598741 |
79546e16ca277d9150931a586f3b32b499e96abb | 3,058 | py | Python | twitter_feels/apps/thermometer/management/commands/load_feelings.py | michaelbrooks/twitter-feels | 51dc00478f05841f3726edf5f7da7e0a46ae66e8 | [
"MIT"
] | 1 | 2017-02-15T10:55:26.000Z | 2017-02-15T10:55:26.000Z | twitter_feels/apps/thermometer/management/commands/load_feelings.py | michaelbrooks/twitter-feels | 51dc00478f05841f3726edf5f7da7e0a46ae66e8 | [
"MIT"
] | null | null | null | twitter_feels/apps/thermometer/management/commands/load_feelings.py | michaelbrooks/twitter-feels | 51dc00478f05841f3726edf5f7da7e0a46ae66e8 | [
"MIT"
] | null | null | null | import logging
from logging.config import dictConfig
from os import path
from optparse import make_option
import csv
from django.core.management.base import BaseCommand
from datetime import timedelta
from django.utils import timezone
from ...models import FeelingWord
# Setup logging if not already configured
logg... | 28.849057 | 112 | 0.545782 |
79546e2ce4f2528149b0ab925e5a431520c06bcf | 12,083 | py | Python | spark_pipeline_framework_testing/tests_common/mock_requests_loader.py | icanbwell/SparkPipelineFramework.Testing | 6dc83fe7afa77aa4107ddb40b6920361460554dc | [
"Apache-2.0"
] | 1 | 2020-10-31T23:25:03.000Z | 2020-10-31T23:25:03.000Z | spark_pipeline_framework_testing/tests_common/mock_requests_loader.py | imranq2/SparkPipelineFramework.Testing | 6dc83fe7afa77aa4107ddb40b6920361460554dc | [
"Apache-2.0"
] | null | null | null | spark_pipeline_framework_testing/tests_common/mock_requests_loader.py | imranq2/SparkPipelineFramework.Testing | 6dc83fe7afa77aa4107ddb40b6920361460554dc | [
"Apache-2.0"
] | null | null | null | import json
import os
from glob import glob
from pathlib import Path
from typing import Dict, Any, List, Optional
from spark_pipeline_framework_testing.mockserver_client.mockserver_client import (
MockServerFriendlyClient,
request,
response,
times,
text_equals,
times_any,
json_equals,
)
d... | 33.751397 | 123 | 0.564347 |
79546ed1ce17d21396da8e001c3f407a17bde91e | 867 | py | Python | functions/utils.py | muellermax/nlp-disaster-app | bd9af53cb7ae6b2064abdd4843d8d2556ccd523b | [
"Unlicense"
] | null | null | null | functions/utils.py | muellermax/nlp-disaster-app | bd9af53cb7ae6b2064abdd4843d8d2556ccd523b | [
"Unlicense"
] | null | null | null | functions/utils.py | muellermax/nlp-disaster-app | bd9af53cb7ae6b2064abdd4843d8d2556ccd523b | [
"Unlicense"
] | null | null | null | # This module was necessary as after deployment to Heroku the tokenize function could not be found.
# So train_classifier and run both access this file.
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
import nltk
nltk.download('punkt')
nltk.download... | 27.09375 | 100 | 0.71857 |
79546f2244899e41c39dd91e4f9a393cd95f43ba | 2,188 | py | Python | twitter/__init__.py | NadiaFida/python-twitter | e62f974fabf28a65eb0094a7fe5324d7ff83308c | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | twitter/__init__.py | NadiaFida/python-twitter | e62f974fabf28a65eb0094a7fe5324d7ff83308c | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | twitter/__init__.py | NadiaFida/python-twitter | e62f974fabf28a65eb0094a7fe5324d7ff83308c | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2007-2018 The Python-Twitter Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICE... | 38.385965 | 74 | 0.552559 |
79546f367c679fe0a212c9561942dcaa6fab1f35 | 852 | py | Python | home/migrations/0019_auto_20210204_1139.py | rachelhs/wagtail-starter | 2363517fd91e279d564ff899dfa3cdfd7ec01aa9 | [
"MIT"
] | null | null | null | home/migrations/0019_auto_20210204_1139.py | rachelhs/wagtail-starter | 2363517fd91e279d564ff899dfa3cdfd7ec01aa9 | [
"MIT"
] | null | null | null | home/migrations/0019_auto_20210204_1139.py | rachelhs/wagtail-starter | 2363517fd91e279d564ff899dfa3cdfd7ec01aa9 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.5 on 2021-02-04 11:39
from django.db import migrations
import wagtail.core.blocks
import wagtail.core.fields
import wagtailstreamforms.blocks
class Migration(migrations.Migration):
dependencies = [
('home', '0018_auto_20210204_1138'),
]
operations = [
migration... | 38.727273 | 432 | 0.700704 |
79546f779a2b4576ff5738ea5ceda70c191bd67c | 390 | py | Python | flags/middleware.py | mdunc/django-flags | 7fdb7a67da25df197f53df4bfa06c8e5175944a3 | [
"CC0-1.0"
] | 142 | 2018-07-27T15:38:13.000Z | 2022-03-19T19:09:44.000Z | flags/middleware.py | mdunc/django-flags | 7fdb7a67da25df197f53df4bfa06c8e5175944a3 | [
"CC0-1.0"
] | 64 | 2018-06-25T14:21:35.000Z | 2022-03-14T17:42:18.000Z | flags/middleware.py | mdunc/django-flags | 7fdb7a67da25df197f53df4bfa06c8e5175944a3 | [
"CC0-1.0"
] | 24 | 2018-10-09T20:05:36.000Z | 2022-03-29T16:34:30.000Z | import warnings
from django.core.exceptions import MiddlewareNotUsed
class FlagConditionsMiddleware:
def __init__(self, get_response):
warnings.warn(
"FlagConditionsMiddleware is deprecated and no longer has any "
"effect. It will be removed in a future version of Django-Flags. ",... | 27.857143 | 79 | 0.684615 |
795470524ee045bfe3de358d7ed1a49b8dacdcfa | 1,020 | py | Python | cryptohack/ctrime/ctrime.py | onealmond/hacking-lab | 631e615944add02db3c2afef47bf1de7171eb065 | [
"MIT"
] | 9 | 2021-04-20T15:28:36.000Z | 2022-03-08T19:53:48.000Z | cryptohack/ctrime/ctrime.py | onealmond/hacking-lab | 631e615944add02db3c2afef47bf1de7171eb065 | [
"MIT"
] | null | null | null | cryptohack/ctrime/ctrime.py | onealmond/hacking-lab | 631e615944add02db3c2afef47bf1de7171eb065 | [
"MIT"
] | 6 | 2021-06-24T03:25:21.000Z | 2022-02-20T21:44:52.000Z | #!/usr/bin/env python3
import time
import requests
import string
def print_blk(hex_blks, sz):
for i in range(0, len(hex_blks), sz):
print(hex_blks[i:i+sz], ' ', end='')
print()
def encrypt(plain):
url = 'http://aes.cryptohack.org/ctrime/encrypt/'
rsp = requests.get(url + plain + '/')
return r... | 23.72093 | 90 | 0.512745 |
7954705ffaab5c71c11f77875ee00d15f66974ea | 36,632 | py | Python | cinder/backup/chunkeddriver.py | scottwedge/openstack-cinder | 08e90b0d89d6f7e84cb774f82d0886dde131ce98 | [
"Apache-2.0"
] | null | null | null | cinder/backup/chunkeddriver.py | scottwedge/openstack-cinder | 08e90b0d89d6f7e84cb774f82d0886dde131ce98 | [
"Apache-2.0"
] | null | null | null | cinder/backup/chunkeddriver.py | scottwedge/openstack-cinder | 08e90b0d89d6f7e84cb774f82d0886dde131ce98 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2014 TrilioData, Inc
# Copyright (c) 2015 EMC Corporation
# Copyright (C) 2015 Kevin Fox <kevin@efox.cc>
# Copyright (C) 2015 Tom Barron <tpb@dyncloud.net>
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "Li... | 43.818182 | 84 | 0.593716 |
795470d88933e314b3e2fdf8dd3957ab05b3d47e | 123 | py | Python | seleniumwire/__init__.py | acidbotmaker/selenium-wire | 969fca764191a60794780146a5be45d78032bc0d | [
"MIT"
] | null | null | null | seleniumwire/__init__.py | acidbotmaker/selenium-wire | 969fca764191a60794780146a5be45d78032bc0d | [
"MIT"
] | null | null | null | seleniumwire/__init__.py | acidbotmaker/selenium-wire | 969fca764191a60794780146a5be45d78032bc0d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Top-level package for Selenium Wire."""
__author__ = """Will Keeling"""
__version__ = '2.1.2'
| 17.571429 | 42 | 0.609756 |
7954715a234b9701569edd77908231e729826b2b | 575 | py | Python | accounts/signals.py | Panda4817/MySousChef | 64c3967566b3834d578406884ee6b4a3807b21f8 | [
"MIT"
] | 1 | 2021-02-25T17:54:28.000Z | 2021-02-25T17:54:28.000Z | recipes/signals.py | Panda4817/MySousChef | 64c3967566b3834d578406884ee6b4a3807b21f8 | [
"MIT"
] | null | null | null | recipes/signals.py | Panda4817/MySousChef | 64c3967566b3834d578406884ee6b4a3807b21f8 | [
"MIT"
] | null | null | null | from django.contrib.auth.signals import user_logged_out, user_logged_in
from django.contrib import messages
# Custom signal and message for when user signs out
def show_logout_message(sender, user, request, **kwargs):
messages.info(request, 'You have been logged out', fail_silently=True)
# Custom signa... | 38.333333 | 75 | 0.782609 |
79547187bd59b5a2ba14e2426bff9da2e3252285 | 8,405 | py | Python | bin/add_revision.py | tdopierre/acl-anthology | 8eed8a3fb0afa68ff2b6580626ee7c66de29694e | [
"Apache-2.0"
] | 221 | 2017-06-05T04:44:41.000Z | 2022-02-11T20:23:31.000Z | bin/add_revision.py | tdopierre/acl-anthology | 8eed8a3fb0afa68ff2b6580626ee7c66de29694e | [
"Apache-2.0"
] | 1,498 | 2017-08-09T13:41:49.000Z | 2022-03-31T02:56:58.000Z | bin/add_revision.py | tdopierre/acl-anthology | 8eed8a3fb0afa68ff2b6580626ee7c66de29694e | [
"Apache-2.0"
] | 183 | 2017-10-28T00:56:49.000Z | 2022-03-14T14:55:00.000Z | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2019 Matt Post <post@cs.jhu.edu>
#
# 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... | 31.716981 | 93 | 0.612731 |
795471a47a4c337a042a18e73f2bfabcc488d758 | 1,116 | py | Python | project_euler/python/179.py | hacktoolkit/code_challenges | d71f8362496a72963a53abba7bcc9dd4d35a2920 | [
"MIT"
] | 10 | 2015-01-31T09:04:45.000Z | 2022-01-08T04:09:48.000Z | project_euler/python/179.py | hacktoolkit/code_challenges | d71f8362496a72963a53abba7bcc9dd4d35a2920 | [
"MIT"
] | 3 | 2016-05-16T07:37:01.000Z | 2016-05-18T14:14:16.000Z | project_euler/python/179.py | hacktoolkit/code_challenges | d71f8362496a72963a53abba7bcc9dd4d35a2920 | [
"MIT"
] | 6 | 2015-02-06T06:00:00.000Z | 2020-02-13T16:13:48.000Z | """
http://projecteuler.net/problem=179
Consecutive positive divisors
Find the number of integers 1 < n < 10^7, for which n and n + 1 have the same number of positive divisors. For example, 14 has the positive divisors 1, 2, 7, 14 while 15 has 1, 3, 5, 15.
Solution by jontsai <hello@jontsai.com>
"""
from utils impor... | 22.77551 | 186 | 0.606631 |
7954729660e749e8c7452ff3c5bc8a3176146388 | 1,611 | py | Python | run/run_robomove.py | silvanmelchior/CBF-SSM | 34a5300f4b9a58e945c04d6c85f6e649ec63e609 | [
"Apache-2.0",
"MIT"
] | 7 | 2019-08-02T17:08:39.000Z | 2021-10-06T07:52:28.000Z | run/run_robomove.py | silvanmelchior/CBF-SSM | 34a5300f4b9a58e945c04d6c85f6e649ec63e609 | [
"Apache-2.0",
"MIT"
] | 4 | 2020-01-28T22:50:40.000Z | 2021-08-25T15:39:34.000Z | run/run_robomove.py | silvanmelchior/CBF-SSM | 34a5300f4b9a58e945c04d6c85f6e649ec63e609 | [
"Apache-2.0",
"MIT"
] | null | null | null | import numpy as np
from cbfssm.datasets import RoboMove
from cbfssm.training import Trainer
from cbfssm.outputs import OutputsRoboMove
from cbfssm.model import CBFSSM
# curriculum learning scheme presented in appendix
# first train w/o entropy, then add it
for phase in range(2):
#
# Config
#
root_dir... | 23.691176 | 61 | 0.571695 |
795472ef2f4cc97e2262386f93ca8ca3420c8b7f | 187 | py | Python | 1stSemester_PythonCourse/work7/E01_1827406005.py | chenyz2000/schoolCourses | cca7f25b0f44186e0c248b26b5d7ed2bcb23c630 | [
"MIT"
] | null | null | null | 1stSemester_PythonCourse/work7/E01_1827406005.py | chenyz2000/schoolCourses | cca7f25b0f44186e0c248b26b5d7ed2bcb23c630 | [
"MIT"
] | null | null | null | 1stSemester_PythonCourse/work7/E01_1827406005.py | chenyz2000/schoolCourses | cca7f25b0f44186e0c248b26b5d7ed2bcb23c630 | [
"MIT"
] | null | null | null | def func1(s):
if len(s) < 2:
return ''
else:
return s[:2] + s[-2:]
if __name__=="__main__":
print(func1("python"))
print(func1("py"))
print(func1("p")) | 20.777778 | 29 | 0.497326 |
795473ef8c0dfe7722973dc8cfed86ac2c8e50e6 | 19,917 | py | Python | bpnet/metrics.py | mlweilert/bpnet | dcc9e8d805f9de774ae9dcc62c20504915be614f | [
"MIT"
] | 93 | 2019-08-15T19:49:19.000Z | 2022-03-04T08:23:44.000Z | bpnet/metrics.py | mlweilert/bpnet | dcc9e8d805f9de774ae9dcc62c20504915be614f | [
"MIT"
] | 29 | 2019-08-15T15:44:44.000Z | 2022-03-28T06:56:07.000Z | bpnet/metrics.py | mlweilert/bpnet | dcc9e8d805f9de774ae9dcc62c20504915be614f | [
"MIT"
] | 24 | 2019-08-29T18:54:36.000Z | 2022-03-23T21:04:46.000Z | import sklearn.metrics as skm
import logging
import matplotlib.pyplot as plt
from bpnet.utils import read_pkl
from keras.models import load_model
from bpnet.utils import _listify, create_tf_session
from bpnet.stats import permute_array
from bpnet.functions import softmax, mean
import os
import json
from tqdm import tqd... | 29.7713 | 96 | 0.609279 |
795473f6eecddf8eaa697c39175e4c412b8a0c6a | 2,711 | py | Python | src/utsc/core/_vendor/boltons/deprutils.py | utsc-networking/utsc-tools | d5bc10cf825f1be46999d5a42da62cc0df456f0c | [
"MIT"
] | null | null | null | src/utsc/core/_vendor/boltons/deprutils.py | utsc-networking/utsc-tools | d5bc10cf825f1be46999d5a42da62cc0df456f0c | [
"MIT"
] | null | null | null | src/utsc/core/_vendor/boltons/deprutils.py | utsc-networking/utsc-tools | d5bc10cf825f1be46999d5a42da62cc0df456f0c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2013, Mahmoud Hashemi
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of condit... | 37.136986 | 72 | 0.729989 |
795474c5186cff30ef63f8a6d5bf537a367490c3 | 492 | py | Python | pktfwd/config/region_config_filenames.py | KevinWassermann94/hm-pktfwd | 57f52a507759c57a4fe0a6baeb315cf3cb9e668f | [
"MIT"
] | null | null | null | pktfwd/config/region_config_filenames.py | KevinWassermann94/hm-pktfwd | 57f52a507759c57a4fe0a6baeb315cf3cb9e668f | [
"MIT"
] | null | null | null | pktfwd/config/region_config_filenames.py | KevinWassermann94/hm-pktfwd | 57f52a507759c57a4fe0a6baeb315cf3cb9e668f | [
"MIT"
] | null | null | null | REGION_CONFIG_FILENAMES = {
"AS923_1": "AS923-1-global_conf.json",
"AS923_2": "AS923-2-global_conf.json",
"AS923_3": "AS923-3-global_conf.json",
"AS923_4": "AS923-4-global_conf.json",
"AU915": "AU-global_conf.json",
"CN470": "CN-global_conf.json",
"EU433": "EU433-global_conf.json",
"EU86... | 32.8 | 42 | 0.638211 |
795476239b962d6c9d16cb8cc2048f7b2b08fcf8 | 1,990 | py | Python | SpiderExercise/day_04/12306.py | tjhlp/SmallSpider | 5518fbd14d66d3b0aca5ac8871839b7e1de49d47 | [
"MIT"
] | null | null | null | SpiderExercise/day_04/12306.py | tjhlp/SmallSpider | 5518fbd14d66d3b0aca5ac8871839b7e1de49d47 | [
"MIT"
] | null | null | null | SpiderExercise/day_04/12306.py | tjhlp/SmallSpider | 5518fbd14d66d3b0aca5ac8871839b7e1de49d47 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from selenium import webdriver
import time
from PIL import Image
from io import BytesIO
from selenium.webdriver import ActionChains
from day_04.YDMHTTP import decode
browser = webdriver.Chrome('./chromedriver.exe')
fs = "武汉,WHN"
ts = "深圳,SZQ"
date = "2019-09-03"
base_url = 'https://kyfw.1230... | 26.184211 | 109 | 0.685427 |
79547692c5be877b643e56e3ee1f618e709997d6 | 68,469 | py | Python | python/tests/test_drawing.py | hyanwong/tskit | f1c5e29e2f4ed022a436895cea3e92f21e368ec6 | [
"MIT"
] | null | null | null | python/tests/test_drawing.py | hyanwong/tskit | f1c5e29e2f4ed022a436895cea3e92f21e368ec6 | [
"MIT"
] | null | null | null | python/tests/test_drawing.py | hyanwong/tskit | f1c5e29e2f4ed022a436895cea3e92f21e368ec6 | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2018-2019 Tskit Developers
# Copyright (C) 2017 University of Oxford
#
# 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 l... | 35.549844 | 89 | 0.469804 |
795476df996dd18d4b54f6eabe35efb1ef4fea5f | 15,974 | py | Python | flappy.py | NikhilSharma0409/Flappy-Bird-Using-Python | d3324084f85d9d8442779728f69636ab05170ee5 | [
"MIT"
] | 2 | 2021-08-24T06:49:05.000Z | 2021-08-25T03:01:40.000Z | flappy.py | NikhilSharma0409/Flappy-Bird-Using-Python | d3324084f85d9d8442779728f69636ab05170ee5 | [
"MIT"
] | null | null | null | flappy.py | NikhilSharma0409/Flappy-Bird-Using-Python | d3324084f85d9d8442779728f69636ab05170ee5 | [
"MIT"
] | null | null | null | from itertools import cycle
import random
import sys
import pygame
from pygame.locals import *
FPS = 40
SCREENWIDTH = 288
SCREENHEIGHT = 512
PIPEGAPSIZE = 125 # gap between upper and lower part of pipe
BASEY = SCREENHEIGHT * 0.79
# image, sound and hitmask dicts
IMAGES, SOUNDS, HITMASKS = {}, {}, {}
# list... | 32.733607 | 90 | 0.582321 |
7954771e56a748db05a1e9b4e24e853058898f51 | 983 | py | Python | config.py | rougeo/flask-gentelella | b8d8c39fdb45472d68e69502155fb06cdb0d6c61 | [
"MIT"
] | null | null | null | config.py | rougeo/flask-gentelella | b8d8c39fdb45472d68e69502155fb06cdb0d6c61 | [
"MIT"
] | null | null | null | config.py | rougeo/flask-gentelella | b8d8c39fdb45472d68e69502155fb06cdb0d6c61 | [
"MIT"
] | null | null | null | from os import environ
class Config(object):
SECRET_KEY = 'key'
SQLALCHEMY_DATABASE_URI = 'sqlite:///database.db'
SQLALCHEMY_TRACK_MODIFICATIONS = False
# THEME SUPPORT
# if set then url_for('static', filename='', theme='')
# will add the theme name to the static URL:
# /static/<DEFA... | 25.868421 | 67 | 0.669379 |
795478c4a9a2fbd2f6ce3883119af5d0c804f58d | 34,782 | py | Python | python/taichi/lang/matrix.py | arisliang/taichi | c775649705195a84e17a04432b60e796f31dee5c | [
"MIT"
] | null | null | null | python/taichi/lang/matrix.py | arisliang/taichi | c775649705195a84e17a04432b60e796f31dee5c | [
"MIT"
] | null | null | null | python/taichi/lang/matrix.py | arisliang/taichi | c775649705195a84e17a04432b60e796f31dee5c | [
"MIT"
] | null | null | null | import copy
import numbers
from collections.abc import Iterable
import numpy as np
from taichi.lang import expr, impl
from taichi.lang import ops as ops_mod
from taichi.lang import kernel_impl as kern_mod
from taichi.lang.common_ops import TaichiOperations
from taichi.lang.exception import TaichiSyntaxError
from taich... | 34.166994 | 142 | 0.505951 |
79547904c009f3f7a09b0624a0758552e9366bd2 | 1,102 | py | Python | packages/services/examples/node/main.py | xjc90s/jupyterlab | 82df0b635dae2c1a70a7c41fe7ee7af1c1caefb2 | [
"BSD-3-Clause"
] | null | null | null | packages/services/examples/node/main.py | xjc90s/jupyterlab | 82df0b635dae2c1a70a7c41fe7ee7af1c1caefb2 | [
"BSD-3-Clause"
] | 8 | 2022-01-04T19:19:07.000Z | 2022-03-03T22:11:12.000Z | packages/services/examples/node/main.py | xjc90s/jupyterlab | 82df0b635dae2c1a70a7c41fe7ee7af1c1caefb2 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import absolute_import, print_function
import json
import os.path as osp
from jupyterlab_server.process import which
from jupyterlab_server.process_app import ProcessApp
HERE = osp.dirname(osp.realpa... | 26.878049 | 99 | 0.671506 |
79547994d102841a4ca227cc1b5815c6c8076e27 | 310 | py | Python | BizPy/openpyxl/20200212/read_all_cells.py | t2y/python-study | 52a132ea600d4696164e540d8a8f8f5fc58e097a | [
"Apache-2.0"
] | 18 | 2016-08-15T00:24:44.000Z | 2020-11-30T15:11:52.000Z | BizPy/openpyxl/20200212/read_all_cells.py | t2y/python-study | 52a132ea600d4696164e540d8a8f8f5fc58e097a | [
"Apache-2.0"
] | null | null | null | BizPy/openpyxl/20200212/read_all_cells.py | t2y/python-study | 52a132ea600d4696164e540d8a8f8f5fc58e097a | [
"Apache-2.0"
] | 6 | 2016-09-28T10:47:03.000Z | 2020-10-14T10:20:06.000Z | import sys
from openpyxl import load_workbook
filename = sys.argv[1]
wb = load_workbook(filename, read_only=True)
print(f'{filename} のワークシート情報を読み込みます')
ws0 = wb.worksheets[0]
print(f'{ws0.title} のセルを1行ずつ表示します')
for row in ws0:
values = [str(column.value) for column in row]
print(values)
| 23.846154 | 51 | 0.712903 |
795479e3a5ed99ebc20af2487244637d0535963a | 44,848 | py | Python | madgraph/madweight/mod_file.py | valassi/mg5amc_test | 2e04f23353051f64e1604b23105fe3faabd32869 | [
"NCSA"
] | 1 | 2016-07-09T00:05:56.000Z | 2016-07-09T00:05:56.000Z | madgraph/madweight/mod_file.py | valassi/mg5amc_test | 2e04f23353051f64e1604b23105fe3faabd32869 | [
"NCSA"
] | 4 | 2022-03-10T09:13:31.000Z | 2022-03-30T16:15:01.000Z | madgraph/madweight/mod_file.py | valassi/mg5amc_test | 2e04f23353051f64e1604b23105fe3faabd32869 | [
"NCSA"
] | 1 | 2016-07-09T00:06:15.000Z | 2016-07-09T00:06:15.000Z | #!/usr/bin/env python
####################################################################################################
####################################################################################################
## ... | 54.033735 | 187 | 0.417566 |
79547b1a033bc78ce4a769f4afd9c05190ea0974 | 24,529 | py | Python | utils.py | chuzcjoe/TriNet | d2689de7362f1845b5c399f1f9f66f42eb4df23f | [
"MIT"
] | 10 | 2020-02-12T20:54:10.000Z | 2022-03-17T03:18:54.000Z | utils.py | chuzcjoe/TriNet | d2689de7362f1845b5c399f1f9f66f42eb4df23f | [
"MIT"
] | 2 | 2020-04-24T22:18:41.000Z | 2021-12-27T05:22:09.000Z | utils.py | chuzcjoe/TriNet | d2689de7362f1845b5c399f1f9f66f42eb4df23f | [
"MIT"
] | 2 | 2020-02-12T20:54:37.000Z | 2020-03-26T05:17:33.000Z | # -*- coding:utf-8 -*-
"""
utils script
"""
import os
import cv2
import torch
import numpy as np
import matplotlib
#matplotlib.use("Qt4Agg")
import math
import matplotlib.pyplot as plt
from math import cos, sin
from mpl_toolkits.mplot3d.axes3d import Axes3D
#from rotation import Rotation as R
from scipy.linalg impo... | 33.60137 | 156 | 0.619838 |
79547c715fbce146ff26b3b55d49f985cd525493 | 6,236 | py | Python | diffy/plugins/diffy_local/plugin.py | TheGableMethod/diffy | f3f22cfdee4103619355c0987a4bfedf9f053a29 | [
"Apache-2.0"
] | 577 | 2018-05-02T02:04:11.000Z | 2022-03-16T00:57:42.000Z | diffy/plugins/diffy_local/plugin.py | TheGableMethod/diffy | f3f22cfdee4103619355c0987a4bfedf9f053a29 | [
"Apache-2.0"
] | 220 | 2018-07-19T20:33:39.000Z | 2021-03-26T15:02:16.000Z | diffy/plugins/diffy_local/plugin.py | TheGableMethod/diffy | f3f22cfdee4103619355c0987a4bfedf9f053a29 | [
"Apache-2.0"
] | 69 | 2018-05-01T23:10:15.000Z | 2021-11-18T19:09:00.000Z | """
.. module: diffy.plugins.diffy_simple.plugin
:platform: Unix
:copyright: (c) 2018 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
"""
import os
import subprocess
import shlex
import datetime
import json
import l... | 34.076503 | 112 | 0.63374 |
79547cb55b685aff822257a06ee558ae5217e4af | 16,684 | py | Python | build/PureCloudPlatformClientV2/models/twitter_integration.py | cjohnson-ctl/platform-client-sdk-python | 38ce53bb8012b66e8a43cc8bd6ff00cf6cc99100 | [
"MIT"
] | 10 | 2019-02-22T00:27:08.000Z | 2021-09-12T23:23:44.000Z | libs/PureCloudPlatformClientV2/models/twitter_integration.py | rocketbot-cl/genesysCloud | dd9d9b5ebb90a82bab98c0d88b9585c22c91f333 | [
"MIT"
] | 5 | 2018-06-07T08:32:00.000Z | 2021-07-28T17:37:26.000Z | libs/PureCloudPlatformClientV2/models/twitter_integration.py | rocketbot-cl/genesysCloud | dd9d9b5ebb90a82bab98c0d88b9585c22c91f333 | [
"MIT"
] | 6 | 2020-04-09T17:43:07.000Z | 2022-02-17T08:48:05.000Z | # coding: utf-8
"""
Copyright 2016 SmartBear Software
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... | 28.716007 | 131 | 0.593443 |
795480e9b38e5f2f570f738b1942a5c0f676e524 | 880 | py | Python | es_enas/util.py | DionysisChristopoulos/google-research | 7f59ef421beef32ca16c2a7215be74f7eba01a0f | [
"Apache-2.0"
] | 23,901 | 2018-10-04T19:48:53.000Z | 2022-03-31T21:27:42.000Z | es_enas/util.py | DionysisChristopoulos/google-research | 7f59ef421beef32ca16c2a7215be74f7eba01a0f | [
"Apache-2.0"
] | 891 | 2018-11-10T06:16:13.000Z | 2022-03-31T10:42:34.000Z | es_enas/util.py | admariner/google-research | 7cee4b22b925581d912e8d993625c180da2a5a4f | [
"Apache-2.0"
] | 6,047 | 2018-10-12T06:31:02.000Z | 2022-03-31T13:59:28.000Z | # coding=utf-8
# Copyright 2021 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... | 33.846154 | 74 | 0.738636 |
795481e95914a38bc2800e4065717858155f3bb4 | 5,856 | py | Python | catboost/pytest/lib/common_helpers.py | EkaterinaPogodina/catboost | 4628e86e978da2ec5e4d42f6b8d05e0b5e8aab30 | [
"Apache-2.0"
] | 2 | 2019-07-10T10:49:09.000Z | 2020-06-19T11:40:04.000Z | catboost/pytest/lib/common_helpers.py | EkaterinaPogodina/catboost | 4628e86e978da2ec5e4d42f6b8d05e0b5e8aab30 | [
"Apache-2.0"
] | null | null | null | catboost/pytest/lib/common_helpers.py | EkaterinaPogodina/catboost | 4628e86e978da2ec5e4d42f6b8d05e0b5e8aab30 | [
"Apache-2.0"
] | null | null | null | import csv
import json
import os
import random
import shutil
from copy import deepcopy
import numpy as np
__all__ = [
'DelayedTee',
'binary_path',
'compare_evals',
'compare_evals_with_precision',
'compare_metrics_with_diff',
'generate_random_labeled_set',
'permute_dataset_columns',
're... | 34.857143 | 102 | 0.654713 |
79548272bcc99ddebad7312b4d36d9cbdafa6509 | 2,146 | py | Python | configs/_base_/datasets/rain_filtering.py | kencan7749/mmsegmentation | e0fe1cb56e5b91f85e33a3ecc3afbeaa31f647e8 | [
"Apache-2.0"
] | null | null | null | configs/_base_/datasets/rain_filtering.py | kencan7749/mmsegmentation | e0fe1cb56e5b91f85e33a3ecc3afbeaa31f647e8 | [
"Apache-2.0"
] | null | null | null | configs/_base_/datasets/rain_filtering.py | kencan7749/mmsegmentation | e0fe1cb56e5b91f85e33a3ecc3afbeaa31f647e8 | [
"Apache-2.0"
] | null | null | null | # dataset settings
dataset_type = "ParticleDataset"
data_root ="data/rain_filtering_v2"#"/var/datasets/rain_filtering/"
#the order of mean or std should be ['first_depth', 'first_intensity', 'first_return_type',
# 'last_depth', 'last_intensity', 'last_return_type']
img_norm_cfg = dict(
mean=[5038.093, 8.658958, 5.9... | 35.180328 | 94 | 0.643057 |
7954840fe05abd133363975138b78d15840c83a5 | 5,333 | py | Python | tests/charts-out/test_graphics_charts_barcharts_sampleV5c4.py | debragail/reportlab-mirror | 1e5814e1313ed50d5abb65487b207711cb4f7595 | [
"BSD-3-Clause"
] | 1 | 2020-05-21T23:34:55.000Z | 2020-05-21T23:34:55.000Z | tests/charts-out/test_graphics_charts_barcharts_sampleV5c4.py | debragail/reportlab-mirror | 1e5814e1313ed50d5abb65487b207711cb4f7595 | [
"BSD-3-Clause"
] | null | null | null | tests/charts-out/test_graphics_charts_barcharts_sampleV5c4.py | debragail/reportlab-mirror | 1e5814e1313ed50d5abb65487b207711cb4f7595 | [
"BSD-3-Clause"
] | null | null | null | #Autogenerated by ReportLab guiedit do not edit
from reportlab.graphics.shapes import _DrawingEditorMixin, Drawing, Group, Rect, Line, String
from reportlab.lib.colors import Color, CMYKColor, PCMYKColor
class ExplodedDrawing_Drawing(_DrawingEditorMixin,Drawing):
def __init__(self,width=400,height=200,*args,**kw):
... | 100.622642 | 227 | 0.775173 |
795484531e3aa9da071a5a39cf1ca3f1d78b078c | 14,645 | py | Python | protecode/client.py | zkdev/cc-utils | 042c6632ca6f61a484bc0a71f85957aeba7f7278 | [
"BSD-3-Clause"
] | null | null | null | protecode/client.py | zkdev/cc-utils | 042c6632ca6f61a484bc0a71f85957aeba7f7278 | [
"BSD-3-Clause"
] | null | null | null | protecode/client.py | zkdev/cc-utils | 042c6632ca6f61a484bc0a71f85957aeba7f7278 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2019-2020 SAP SE or an SAP affiliate company. All rights reserved. This file is
# licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the L... | 32.257709 | 100 | 0.612496 |
7954845c51b9d47639fb69428343a2ab19ea5d6b | 1,750 | py | Python | rpmreq/helpers.py | softwarefactory-project/rpmreq | b9b30cf6a184929db23ac86c8cc037592ee8b6be | [
"Apache-2.0"
] | null | null | null | rpmreq/helpers.py | softwarefactory-project/rpmreq | b9b30cf6a184929db23ac86c8cc037592ee8b6be | [
"Apache-2.0"
] | null | null | null | rpmreq/helpers.py | softwarefactory-project/rpmreq | b9b30cf6a184929db23ac86c8cc037592ee8b6be | [
"Apache-2.0"
] | 1 | 2019-03-10T10:07:04.000Z | 2019-03-10T10:07:04.000Z | import contextlib
import hashlib
import logging
import os
import requests
import time
from rpmreq import exception
log = logging.getLogger(__name__)
@contextlib.contextmanager
def cdir(path):
prev_cwd = os.getcwd()
os.chdir(path)
try:
yield
finally:
os.chdir(prev_cwd)
def ensure_d... | 22.727273 | 78 | 0.614286 |
7954846da328529bd18cc0a32e13f23148cda410 | 7,973 | py | Python | kivy/tests/test_utils.py | Galland/kivy | 95a6bf279883d706f645e4629c16d5ee1038f0ec | [
"MIT"
] | 9 | 2016-09-03T07:20:01.000Z | 2020-05-21T14:44:48.000Z | kivy/tests/test_utils.py | Galland/kivy | 95a6bf279883d706f645e4629c16d5ee1038f0ec | [
"MIT"
] | 6 | 2020-01-31T18:04:48.000Z | 2021-06-05T10:53:55.000Z | kivy/tests/test_utils.py | Galland/kivy | 95a6bf279883d706f645e4629c16d5ee1038f0ec | [
"MIT"
] | 4 | 2016-09-10T15:27:54.000Z | 2020-03-27T22:05:31.000Z | '''
utils tests
===========
'''
import os
import unittest
try:
from unittest.mock import patch # python 3.x
except:
from mock import patch # python 2.x
from kivy.utils import (boundary, escape_markup, format_bytes_to_human,
is_color_transparent, SafeList, get_random_color, get_hex_from_color,
... | 34.366379 | 77 | 0.587106 |
795484d85416c13a083ff12b932857b3b5a92852 | 1,804 | py | Python | handlers/client.py | allexvip/bot | e6bedb701abaf5ab9f8fc660ef1129f9d7414cc7 | [
"MIT",
"Unlicense"
] | null | null | null | handlers/client.py | allexvip/bot | e6bedb701abaf5ab9f8fc660ef1129f9d7414cc7 | [
"MIT",
"Unlicense"
] | null | null | null | handlers/client.py | allexvip/bot | e6bedb701abaf5ab9f8fc660ef1129f9d7414cc7 | [
"MIT",
"Unlicense"
] | null | null | null | from aiogram import types, Dispatcher
from create_bot import dp, bot, BOT_NAME, START_MESSAGE
from keyboards import kb_client
from aiogram.types import ReplyKeyboardRemove
from db import sqlite_db
'''******************** Client part ********************************'''
@dp.message_handler(commands=['start', 'help'])
... | 42.952381 | 120 | 0.68847 |
7954861510b636e10ce6a09e5f685a906b70f7cc | 362 | py | Python | evaluate.py | SAIC-M/xeval | bf55874aa2028554d42c6f0bf40b15e9233f12a2 | [
"MIT"
] | 3 | 2018-11-06T16:29:53.000Z | 2018-11-06T16:43:16.000Z | evaluate.py | SAIC-M/xeval | bf55874aa2028554d42c6f0bf40b15e9233f12a2 | [
"MIT"
] | null | null | null | evaluate.py | SAIC-M/xeval | bf55874aa2028554d42c6f0bf40b15e9233f12a2 | [
"MIT"
] | null | null | null | import argparse
import json
from xeval.evaluation.utils import run_evaluation
def main():
parser = argparse.ArgumentParser()
parser.add_argument("config", help="Path to config file")
args = parser.parse_args()
with open(args.config) as fin:
config = json.load(fin)
run_evaluation(config... | 17.238095 | 61 | 0.687845 |
7954869677c535e7b0ae5b3c63c508b9efd937d4 | 6,504 | py | Python | sdk/python/pulumi_azure_nextgen/network/v20200301/get_express_route_gateway.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/network/v20200301/get_express_route_gateway.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/network/v20200301/get_express_route_gateway.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 38.258824 | 192 | 0.672817 |
795486ad2d13e726547293251d1914aea70a5628 | 4,378 | py | Python | cinder/tests/unit/api/v1/stubs.py | rackerlabs/cinder | 4295ff0a64f781c3546f6c6e0816dbb8100133cb | [
"Apache-2.0"
] | 1 | 2019-02-08T05:24:58.000Z | 2019-02-08T05:24:58.000Z | cinder/tests/unit/api/v1/stubs.py | rackerlabs/cinder | 4295ff0a64f781c3546f6c6e0816dbb8100133cb | [
"Apache-2.0"
] | 1 | 2021-03-21T11:38:29.000Z | 2021-03-21T11:38:29.000Z | cinder/tests/unit/api/v1/stubs.py | rackerlabs/cinder | 4295ff0a64f781c3546f6c6e0816dbb8100133cb | [
"Apache-2.0"
] | 15 | 2017-01-12T10:35:10.000Z | 2019-04-19T08:22:10.000Z | # Copyright 2010 OpenStack Foundation
# 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 requ... | 31.049645 | 78 | 0.624486 |
7954888bb3db3ac4ba9dc45e1f2b98e4f3e441db | 4,137 | py | Python | main.py | monologg/CNN-BiLSTM-CRF-NER | 140b23eb5f583050dc39c9648028115ba4b75f09 | [
"Apache-2.0"
] | 16 | 2020-03-22T08:20:42.000Z | 2022-03-16T03:59:40.000Z | main.py | monologg/CNN-BiLSTM-CRF-NER | 140b23eb5f583050dc39c9648028115ba4b75f09 | [
"Apache-2.0"
] | null | null | null | main.py | monologg/CNN-BiLSTM-CRF-NER | 140b23eb5f583050dc39c9648028115ba4b75f09 | [
"Apache-2.0"
] | 8 | 2020-11-23T11:00:12.000Z | 2022-03-31T03:03:54.000Z | import argparse
from trainer import Trainer
from utils import init_logger, build_vocab, download_w2v
from data_loader import load_examples
def main(args):
init_logger()
if not args.no_w2v:
download_w2v(args)
build_vocab(args)
train_dataset = load_examples(args, mode="train")
dev_dataset ... | 54.434211 | 140 | 0.716945 |
795488bdd91b94873278d8d304ecd7aa2951f2b4 | 875 | py | Python | backend/api/btb/api/schema/resolvers/company_by_id.py | serben/project-c | af7d5815fbf6d427b0f414338cee060b0b04ab65 | [
"MIT"
] | 4 | 2020-04-30T16:11:24.000Z | 2020-06-02T10:08:07.000Z | backend/api/btb/api/schema/resolvers/company_by_id.py | serben/project-c | af7d5815fbf6d427b0f414338cee060b0b04ab65 | [
"MIT"
] | 291 | 2020-04-20T13:11:13.000Z | 2022-02-10T21:54:46.000Z | backend/api/btb/api/schema/resolvers/company_by_id.py | serben/project-c | af7d5815fbf6d427b0f414338cee060b0b04ab65 | [
"MIT"
] | 2 | 2020-04-19T14:56:01.000Z | 2020-04-19T18:09:34.000Z | from graphene import ID, String, ObjectType
from btb.api.models import db
from sqlalchemy import text
from promise import Promise
from promise.dataloader import DataLoader
from flask import current_app, g
class CompanyLoader(DataLoader):
def batch_load_fn(self, keys):
current_app.logger.debug("load %s", ... | 30.172414 | 102 | 0.657143 |
795488f529310ef95820f937390a2a41c5a29d6b | 2,465 | py | Python | nova/cert/manager.py | vmthunder/nova | baf05caab705c5778348d9f275dc541747b7c2de | [
"Apache-2.0"
] | 7 | 2015-09-22T11:27:16.000Z | 2015-11-02T12:33:46.000Z | nova/cert/manager.py | vmthunder/nova | baf05caab705c5778348d9f275dc541747b7c2de | [
"Apache-2.0"
] | 9 | 2015-05-20T11:20:17.000Z | 2017-07-27T08:21:33.000Z | nova/cert/manager.py | vmthunder/nova | baf05caab705c5778348d9f275dc541747b7c2de | [
"Apache-2.0"
] | 13 | 2015-05-05T09:34:04.000Z | 2017-11-08T02:03:46.000Z | # Copyright 2012 OpenStack Foundation
#
# 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 ... | 34.71831 | 78 | 0.687221 |
795489bccac3aa363244ac1ebc6cf358d09d1379 | 801 | py | Python | migrations/versions/9a1c299f53be_adding_role.py | oodennis20/Blogs | 074338a69db1d759eb9050138c99b8abbb492cd2 | [
"MIT"
] | null | null | null | migrations/versions/9a1c299f53be_adding_role.py | oodennis20/Blogs | 074338a69db1d759eb9050138c99b8abbb492cd2 | [
"MIT"
] | null | null | null | migrations/versions/9a1c299f53be_adding_role.py | oodennis20/Blogs | 074338a69db1d759eb9050138c99b8abbb492cd2 | [
"MIT"
] | 1 | 2019-12-06T05:05:44.000Z | 2019-12-06T05:05:44.000Z | """adding role
Revision ID: 9a1c299f53be
Revises: f4ae7abcdaa4
Create Date: 2019-12-01 09:02:51.067454
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9a1c299f53be'
down_revision = 'f4ae7abcdaa4'
branch_labels = None
depends_on = None
def upgrade():
# ##... | 25.83871 | 105 | 0.692884 |
795489cf7a20bb5caa99f3a97df23e37e35ac3a2 | 2,291 | py | Python | ee/clickhouse/models/util.py | zegl/posthog | 62846fd565e9eb6ff299bb81dd3b91f219bd0eeb | [
"MIT"
] | 1 | 2020-12-08T04:04:52.000Z | 2020-12-08T04:04:52.000Z | ee/clickhouse/models/util.py | zegl/posthog | 62846fd565e9eb6ff299bb81dd3b91f219bd0eeb | [
"MIT"
] | null | null | null | ee/clickhouse/models/util.py | zegl/posthog | 62846fd565e9eb6ff299bb81dd3b91f219bd0eeb | [
"MIT"
] | null | null | null | import json
from typing import Optional, Union
import pytz
from dateutil.parser import isoparse
from django.utils import timezone
from posthog.models.property import Property
def get_operator(prop: Property, arg: str):
operator = prop.operator
if operator == "is_not":
return "(trim(BOTH '\"' FROM e... | 28.283951 | 126 | 0.55347 |
79548a16e042f2aa938ddd2f709a78ec6e09d678 | 467 | py | Python | src/dashboard/settings.py | karlicoss/dashboard | 708eb183130de31e344fa0f38fa8ae74d1953e31 | [
"MIT"
] | 13 | 2020-08-26T06:25:00.000Z | 2021-07-23T13:54:19.000Z | src/dashboard/settings.py | karlicoss/dashboard | 708eb183130de31e344fa0f38fa8ae74d1953e31 | [
"MIT"
] | null | null | null | src/dashboard/settings.py | karlicoss/dashboard | 708eb183130de31e344fa0f38fa8ae74d1953e31 | [
"MIT"
] | null | null | null | from bokeh.themes import Theme
# https://docs.bokeh.org/en/latest/docs/reference/themes.html
# eh. kind of crappy (I'd much rather prefer python native way of overriding), but at least it works
# Legend.location.property._default = 'top_left' -- didn't work
theme = Theme(json={
'attrs' : {
'Legend': {
... | 33.357143 | 100 | 0.605996 |
79548abfa8ee2ee90425119d3ed259d2e61d908f | 7,897 | py | Python | pyfda/frozendict.py | toddrme2178/pyfda | c20355fb36ace6902aebd1a6bc6c1a71771b84f4 | [
"MIT"
] | 1 | 2019-04-28T15:50:55.000Z | 2019-04-28T15:50:55.000Z | pyfda/frozendict.py | toddrme2178/pyfda | c20355fb36ace6902aebd1a6bc6c1a71771b84f4 | [
"MIT"
] | null | null | null | pyfda/frozendict.py | toddrme2178/pyfda | c20355fb36ace6902aebd1a6bc6c1a71771b84f4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This file is part of the pyFDA project hosted at https://github.com/chipmuenk/pyfda
#
# Copyright © pyFDA Project Contributors
# Licensed under the terms of the MIT License
# (see file LICENSE in root directory for details)
"""
Create an immutable dictionary for the filter tree. The elimina... | 32.364754 | 109 | 0.559959 |
79548b3a3835c0086447f8255cc110ef6cdbe50a | 1,783 | py | Python | project_1/pentest/vuln2.py | BFreitas16/SSof | c6963b76c1c033324593a40139e5918ad6386380 | [
"MIT"
] | null | null | null | project_1/pentest/vuln2.py | BFreitas16/SSof | c6963b76c1c033324593a40139e5918ad6386380 | [
"MIT"
] | null | null | null | project_1/pentest/vuln2.py | BFreitas16/SSof | c6963b76c1c033324593a40139e5918ad6386380 | [
"MIT"
] | null | null | null | import requests, sys, os, random
import time
from bs4 import BeautifulSoup
from selenium_utils import start_driver, write_to_field
SERVER = sys.argv[1]
# SERVER = 'http://d39e092608f9769e2696bf07d987072b4b2dd1dc9bce5e0151910fc276ae.project.ssof.rnl.tecnico.ulisboa.pt/'
session = requests.session()
# Random user cred... | 30.220339 | 117 | 0.719574 |
79548b3b4245cb395a275c85e4e32b13c388fc3b | 644 | py | Python | src/netcheck/__init__.py | vincentdavis/Encrypted-Twitter-Messager | b43f553c26a733496a0a445d04d14aeb40e492f7 | [
"MIT"
] | null | null | null | src/netcheck/__init__.py | vincentdavis/Encrypted-Twitter-Messager | b43f553c26a733496a0a445d04d14aeb40e492f7 | [
"MIT"
] | null | null | null | src/netcheck/__init__.py | vincentdavis/Encrypted-Twitter-Messager | b43f553c26a733496a0a445d04d14aeb40e492f7 | [
"MIT"
] | null | null | null | from kivy import platform
__all__ = ('connection_available', 'set_retry_prompt', 'ask_connect',
'_get_ref')
_Netcheck = None
def _netcheck():
global _Netcheck
if _Netcheck is None:
p = platform()
if p == 'android':
from androidconn import Netcheck
else:
... | 18.4 | 69 | 0.653727 |
79548c4249822c18909fdb16d4b915cf0802d8e6 | 1,936 | py | Python | aliyun-python-sdk-mts/aliyunsdkmts/request/v20140618/QueryPornPipelineListRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | 1 | 2019-12-23T12:36:43.000Z | 2019-12-23T12:36:43.000Z | aliyun-python-sdk-mts/aliyunsdkmts/request/v20140618/QueryPornPipelineListRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-mts/aliyunsdkmts/request/v20140618/QueryPornPipelineListRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | 1 | 2021-02-23T11:27:54.000Z | 2021-02-23T11:27:54.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.851852 | 80 | 0.775826 |
79548ce44174ecb00eede427c249a3630f79692d | 9,463 | py | Python | huaweicloud-sdk-iotda/huaweicloudsdkiotda/v5/model/list_rule_actions_request.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-iotda/huaweicloudsdkiotda/v5/model/list_rule_actions_request.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-iotda/huaweicloudsdkiotda/v5/model/list_rule_actions_request.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import pprint
import re
import six
class ListRuleActionsRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the v... | 31.543333 | 233 | 0.632886 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.