hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | 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 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | 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 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
847f758e230a0b36d8321b68baf9036fdb4ee5c9 | 179 | py | Python | machine_learning/acting/reluTest.py | Heahr/training | 7cba490bc55d5b5bedaf5a6f781fddab1f0859a8 | [
"MIT"
] | null | null | null | machine_learning/acting/reluTest.py | Heahr/training | 7cba490bc55d5b5bedaf5a6f781fddab1f0859a8 | [
"MIT"
] | null | null | null | machine_learning/acting/reluTest.py | Heahr/training | 7cba490bc55d5b5bedaf5a6f781fddab1f0859a8 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pylab as plt
def relu(x):
return np.maximum(0, x)
x = np.arange(-5.0, 5.0, 0.1)
y = relu(x)
plt.plot(x, y)
plt.ylim(-1, 5.5)
plt.show() | 14.916667 | 30 | 0.631285 |
ab4ac979bef0fe727a00b6b1bd307183fe7b21f7 | 2,661 | py | Python | src/poliastro/tests/tests_threebody/test_soi.py | aOrionis/poliastro | 7e73dbcafd837854dba8db1910477b6df3eace93 | [
"MIT"
] | null | null | null | src/poliastro/tests/tests_threebody/test_soi.py | aOrionis/poliastro | 7e73dbcafd837854dba8db1910477b6df3eace93 | [
"MIT"
] | null | null | null | src/poliastro/tests/tests_threebody/test_soi.py | aOrionis/poliastro | 7e73dbcafd837854dba8db1910477b6df3eace93 | [
"MIT"
] | null | null | null | import pytest
from astropy import units as u
from astropy.tests.helper import assert_quantity_allclose
from poliastro.bodies import (
Body,
Earth,
Jupiter,
Mars,
Mercury,
Moon,
Neptune,
Pluto,
Saturn,
Sun,
Uranus,
Venus,
)
from poliastro.threebody.soi import laplace_radi... | 26.346535 | 96 | 0.641864 |
28149c16b298140ba6b41403eac34d6f74cde53a | 663 | py | Python | witwidget/version.py | mpushkarna/what-if-tool | 49b04145bb0b102d107ebfa23e5d66f75b3d76a7 | [
"Apache-2.0"
] | null | null | null | witwidget/version.py | mpushkarna/what-if-tool | 49b04145bb0b102d107ebfa23e5d66f75b3d76a7 | [
"Apache-2.0"
] | 3 | 2021-05-12T10:14:25.000Z | 2022-02-13T22:34:11.000Z | witwidget/version.py | shalevy1/what-if-tool | 49b04145bb0b102d107ebfa23e5d66f75b3d76a7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 36.833333 | 74 | 0.754148 |
3cb72f06fb29df79decb20826d1ed841f73ef2eb | 545 | py | Python | tests/bind_tests/contour_tests/test_add.py | skrat/martinez | 86db48324cb50ecb52be8ab2e4278a6d5cdd562b | [
"MIT"
] | 7 | 2020-05-07T08:13:44.000Z | 2021-12-17T07:33:51.000Z | tests/bind_tests/contour_tests/test_add.py | skrat/martinez | 86db48324cb50ecb52be8ab2e4278a6d5cdd562b | [
"MIT"
] | 17 | 2019-11-29T23:17:26.000Z | 2020-12-20T15:47:17.000Z | tests/bind_tests/contour_tests/test_add.py | skrat/martinez | 86db48324cb50ecb52be8ab2e4278a6d5cdd562b | [
"MIT"
] | 1 | 2020-12-17T22:44:21.000Z | 2020-12-17T22:44:21.000Z | from hypothesis import given
from tests.bind_tests.hints import (BoundContour,
BoundPoint)
from . import strategies
@given(strategies.contours, strategies.points)
def test_basic(contour: BoundContour, point: BoundPoint) -> None:
result = contour.add(point)
assert result i... | 25.952381 | 70 | 0.704587 |
409a75b0d9b32f7784eb2739de4c1dcde664ce64 | 402 | py | Python | homeworks/kirill_shevchuk/lesson11/level05.py | tgrx/Z22 | b2539682ff26c8b6d9f63a7670c8a9c6b614a8ff | [
"Apache-2.0"
] | null | null | null | homeworks/kirill_shevchuk/lesson11/level05.py | tgrx/Z22 | b2539682ff26c8b6d9f63a7670c8a9c6b614a8ff | [
"Apache-2.0"
] | 8 | 2019-11-15T18:15:56.000Z | 2020-02-03T18:05:05.000Z | homeworks/kirill_shevchuk/lesson11/level05.py | tgrx/Z22 | b2539682ff26c8b6d9f63a7670c8a9c6b614a8ff | [
"Apache-2.0"
] | null | null | null | from homeworks.kirill_shevchuk.lesson11 import level04
from homeworks.kirill_shevchuk.hw05.level03 import good_phone
class User(level04.User):
def __init__(self, phone, *args, **kwargs):
self.phone = phone
level04.User.__init__(self, *args, **kwargs)
def validate(self):
level04.User.v... | 28.714286 | 61 | 0.691542 |
2e42fefd8a02fd248732ea0c34a53abb8d41a63a | 189 | py | Python | chapter 03/MyPackage/addfunctions.py | bpbpublications/Python-Data-Persistence | 444cd44b2853c05a84e59e85d4f705ef74395204 | [
"MIT"
] | 6 | 2020-08-16T12:55:01.000Z | 2022-03-08T13:06:23.000Z | chapter 03/MyPackage/addfunctions.py | bpbpublications/Python-Data-Persistence | 444cd44b2853c05a84e59e85d4f705ef74395204 | [
"MIT"
] | null | null | null | chapter 03/MyPackage/addfunctions.py | bpbpublications/Python-Data-Persistence | 444cd44b2853c05a84e59e85d4f705ef74395204 | [
"MIT"
] | 1 | 2020-08-16T12:57:39.000Z | 2020-08-16T12:57:39.000Z | #addfunctions.py
def add(num1,num2):
result=num1+num2
return result
def addall(*nums):
ttl=0
for num in nums:
ttl=ttl+num
return ttl
| 18.9 | 27 | 0.534392 |
d4eed39129689f02ee95db83cc0814f6a29771a9 | 426 | py | Python | simpletr64/actions/__init__.py | danielschenk/simpletr64 | 31081139f4e6c85084a56de1617df73927135466 | [
"Apache-2.0"
] | 12 | 2016-03-27T11:49:13.000Z | 2021-03-13T14:23:01.000Z | simpletr64/actions/__init__.py | tobyp/simpletr64 | 168ba8b50d830d44a6c48c7d71033ba1939c42a8 | [
"Apache-2.0"
] | 4 | 2016-01-11T20:18:20.000Z | 2021-03-13T20:40:46.000Z | simpletr64/actions/__init__.py | tobyp/simpletr64 | 168ba8b50d830d44a6c48c7d71033ba1939c42a8 | [
"Apache-2.0"
] | 11 | 2016-01-11T15:49:44.000Z | 2021-03-13T22:56:29.000Z | """
TR 64 specific actions
~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2015 by Benjamin Pannier.
:license: Apache 2.0, see LICENSE for more details.
"""
from .lan import Lan, HostDetails, EthernetInfo, EthernetStatistic
from .system import System, SystemInfo, TimeInfo
from .wan import Wan, WanLinkInfo, WanLinkProperties... | 30.428571 | 78 | 0.741784 |
e20ea95c20ec0ed10c8b69cff71a3395d75c49f6 | 16,515 | py | Python | arcade/context.py | yegarti/arcade | 1862e61aab9a7dc646265005b0e808d953a9dfe3 | [
"MIT"
] | null | null | null | arcade/context.py | yegarti/arcade | 1862e61aab9a7dc646265005b0e808d953a9dfe3 | [
"MIT"
] | null | null | null | arcade/context.py | yegarti/arcade | 1862e61aab9a7dc646265005b0e808d953a9dfe3 | [
"MIT"
] | null | null | null | """
Arcade's version of the OpenGL Context.
Contains pre-loaded programs
"""
from arcade.gl.compute_shader import ComputeShader
from contextlib import contextmanager
from pathlib import Path
from typing import Dict, Optional, Tuple, Union
import pyglet
from PIL import Image
import arcade
from arcade.gl import BufferD... | 41.704545 | 111 | 0.653951 |
d958d3b4310b218d5f9bb95cba92a3e5748ba95e | 3,202 | py | Python | fine_tuning_utils.py | twilightdema/ALBERT_Thai | 2c5612237a6843c4949dd941dbcd01ca91f82f2b | [
"Apache-2.0"
] | null | null | null | fine_tuning_utils.py | twilightdema/ALBERT_Thai | 2c5612237a6843c4949dd941dbcd01ca91f82f2b | [
"Apache-2.0"
] | 4 | 2020-09-25T22:35:29.000Z | 2022-02-09T23:37:24.000Z | fine_tuning_utils.py | twilightdema/ALBERT_Thai | 2c5612237a6843c4949dd941dbcd01ca91f82f2b | [
"Apache-2.0"
] | 1 | 2020-10-17T01:36:03.000Z | 2020-10-17T01:36:03.000Z | # coding=utf-8
# Copyright 2018 The Google AI Team 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 ... | 38.119048 | 81 | 0.698938 |
01c9da74eade284ec6eb7b174172fb3cb725d030 | 7,542 | py | Python | evaluation/evaluate.py | leandermaben/MaskCycleGAN-Augment | e5d0fbbc2f1dba8dc79926fb8ae0abea347bc14c | [
"MIT"
] | null | null | null | evaluation/evaluate.py | leandermaben/MaskCycleGAN-Augment | e5d0fbbc2f1dba8dc79926fb8ae0abea347bc14c | [
"MIT"
] | null | null | null | evaluation/evaluate.py | leandermaben/MaskCycleGAN-Augment | e5d0fbbc2f1dba8dc79926fb8ae0abea347bc14c | [
"MIT"
] | null | null | null | import librosa
import numpy as np
import soundfile as sf
import torch
import matplotlib.pyplot as plt
import scipy.io.wavfile as wav
from scipy import signal
from pydub import AudioSegment
import math
import random
import argparse
import os
import shutil
#from timeit import default_timer as timer
DATA_DIRECTORY_DEFAUL... | 31.425 | 178 | 0.619597 |
f42a7be533c807bec99f2c84b59e4f0f09491772 | 1,365 | py | Python | Leetcode/medium/reorder-list.py | jen-sjen/data-structures-basics-leetcode | addac32974b16e0a37aa60c210ab7820b349b279 | [
"MIT"
] | 6 | 2021-07-29T03:26:20.000Z | 2022-01-28T15:11:45.000Z | Leetcode/medium/reorder-list.py | jen-sjen/data-structures-basics-leetcode | addac32974b16e0a37aa60c210ab7820b349b279 | [
"MIT"
] | 2 | 2021-09-30T09:47:23.000Z | 2022-01-31T03:08:24.000Z | Leetcode/medium/reorder-list.py | jen-sjen/data-structures-basics-leetcode | addac32974b16e0a37aa60c210ab7820b349b279 | [
"MIT"
] | 5 | 2021-08-10T06:41:11.000Z | 2022-01-29T17:50:20.000Z | """
# REORDER LIST
Given a singly linked list L: L0→L1→…→Ln-1→Ln,
reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…
You may not modify the values in the list's nodes, only nodes itself may be changed.
Example 1:
Given 1->2->3->4, reorder it to 1->4->2->3.
Example 2:
Given 1->2->3->4->5, reorder it to 1->5->2->4->3.
"""
# ... | 23.135593 | 84 | 0.500366 |
834f68e356435995840f9f6926cd73006c368113 | 412 | py | Python | tests/test_repos-formula.py | westurner/repos-formula | b69fae0d0b027669dcee45e6994af8cd3b43a29b | [
"BSD-3-Clause"
] | null | null | null | tests/test_repos-formula.py | westurner/repos-formula | b69fae0d0b027669dcee45e6994af8cd3b43a29b | [
"BSD-3-Clause"
] | null | null | null | tests/test_repos-formula.py | westurner/repos-formula | b69fae0d0b027669dcee45e6994af8cd3b43a29b | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_repos-formula
----------------------------------
Tests for `repos-formula` module.
"""
import unittest
from repos-formula import repos-formula
class TestRepos-formula(unittest.TestCase):
def setUp(self):
pass
def test_something(self):
... | 14.714286 | 43 | 0.589806 |
57d3ce77d5930746646fd2a430e239d591db4474 | 17,032 | py | Python | open_bci_wifi.py | wffirilat/Neurohacking | 4407566ddb1b4a19a27f585a0050ab04b2bc5efe | [
"MIT"
] | 2 | 2018-11-03T19:14:22.000Z | 2021-01-25T23:50:58.000Z | open_bci_wifi.py | kayla-e774/Neurohacking | 4407566ddb1b4a19a27f585a0050ab04b2bc5efe | [
"MIT"
] | 2 | 2018-01-22T23:21:36.000Z | 2018-01-22T23:31:27.000Z | open_bci_wifi.py | kayla-e774/Neurohacking | 4407566ddb1b4a19a27f585a0050ab04b2bc5efe | [
"MIT"
] | 1 | 2018-09-12T02:50:16.000Z | 2018-09-12T02:50:16.000Z | """
Core OpenBCI object for handling connections and samples from the WiFi Shield
Note that the LIB will take care on its own to print incoming ASCII messages if any (FIXME, BTW).
EXAMPLE USE:
def handle_sample(sample):
print(sample.channels_data)
wifi = OpenBCIWifi()
wifi.start(handle_sample)
TODO: Cyton/Gangli... | 37.187773 | 165 | 0.590242 |
3a4fbea7249589a0da2ca9beb2cacafe87e11874 | 345 | py | Python | tests/test_show.py | martinsvoboda/line-item-manager | e77946cffa60c58fc50a935575469bfce9fb34b3 | [
"Apache-2.0"
] | 23 | 2020-10-29T16:12:24.000Z | 2022-03-09T22:11:32.000Z | tests/test_show.py | martinsvoboda/line-item-manager | e77946cffa60c58fc50a935575469bfce9fb34b3 | [
"Apache-2.0"
] | 44 | 2020-12-10T16:47:55.000Z | 2022-03-23T14:16:40.000Z | tests/test_show.py | martinsvoboda/line-item-manager | e77946cffa60c58fc50a935575469bfce9fb34b3 | [
"Apache-2.0"
] | 9 | 2020-12-10T07:47:15.000Z | 2022-03-31T16:58:58.000Z | import shlex
from click.testing import CliRunner
import pytest
from line_item_manager import cli
@pytest.mark.parametrize("command",
[
('config'),
('bidders'),
]
)
def test_cli_show_good(command):
runner = CliRunner()
result = runner.invoke(
cli.show,
shlex.split(command)
)
asse... | 16.428571 | 35 | 0.672464 |
22cd5129aa14bf23eb663b4f972346ada8d37750 | 5,060 | py | Python | tests/app/authentication/test_user_id_generator.py | qateam123/eq | 704757952323647d659c49a71975c56406ff4047 | [
"MIT"
] | null | null | null | tests/app/authentication/test_user_id_generator.py | qateam123/eq | 704757952323647d659c49a71975c56406ff4047 | [
"MIT"
] | 8 | 2020-03-24T15:24:18.000Z | 2022-03-02T04:32:56.000Z | tests/app/authentication/test_user_id_generator.py | qateam123/eq | 704757952323647d659c49a71975c56406ff4047 | [
"MIT"
] | null | null | null | import unittest
from app import settings
from app.authentication.invalid_token_exception import InvalidTokenException
from app.authentication.user_id_generator import UserIDGenerator
class TestUserIDGenerator(unittest.TestCase):
def setUp(self):
settings.EQ_SERVER_SIDE_STORAGE = True
def test_genera... | 51.111111 | 86 | 0.685968 |
9a57534db9119c93d81be49acf8c988143254bf8 | 5,160 | py | Python | test/throughput/env.py | ksc999/tianshou | 8a5e2190f7045ffee2ffa4346c0010693ac7b222 | [
"MIT"
] | 4,714 | 2018-04-16T22:52:05.000Z | 2022-03-31T14:14:51.000Z | test/throughput/env.py | ksc999/tianshou | 8a5e2190f7045ffee2ffa4346c0010693ac7b222 | [
"MIT"
] | 529 | 2020-03-26T00:58:03.000Z | 2022-03-31T01:59:14.000Z | test/throughput/env.py | ksc999/tianshou | 8a5e2190f7045ffee2ffa4346c0010693ac7b222 | [
"MIT"
] | 798 | 2018-05-26T23:34:07.000Z | 2022-03-30T11:26:19.000Z | import gym
import time
import random
import numpy as np
import networkx as nx
from copy import deepcopy
from gym.spaces import Discrete, MultiDiscrete, Box, Dict, Tuple
class MyTestEnv(gym.Env):
"""This is a "going right" task. The task is to go right ``size`` steps.
"""
def __init__(self, size, sleep=0,... | 37.122302 | 76 | 0.542636 |
6b0a49bade5cc04cd9f3b4570d48c1256fa9af47 | 287 | py | Python | proc/test/write.py | wenbobuaa/pykit | 43e38fe40297a1e7a9329bcf3db3554c7ca48ead | [
"MIT"
] | 13 | 2016-12-16T09:23:09.000Z | 2018-03-10T08:04:00.000Z | proc/test/write.py | wenbobuaa/pykit | 43e38fe40297a1e7a9329bcf3db3554c7ca48ead | [
"MIT"
] | 74 | 2017-03-23T11:36:22.000Z | 2018-04-02T06:19:09.000Z | proc/test/write.py | drmingdrmer/pykit | e25a71146e81aaf79625cf8d4f4c439ccd515b82 | [
"MIT"
] | 5 | 2016-12-27T07:30:47.000Z | 2018-03-10T07:06:21.000Z | #!/usr/bin/env python2
# coding: utf-8
import sys
fn = '/tmp/foo'
def write_file(fn, cont):
try:
with open(fn, 'w') as f:
f.write(cont)
except Exception:
raise
if __name__ == '__main__':
args = sys.argv[1:]
write_file(fn, ''.join(args))
| 14.35 | 33 | 0.554007 |
7dff6536084edc8a09c5c9d15c3e4bfd25863316 | 2,733 | py | Python | kahuna/config.py | esagecloudOS/kahuna-master | 0c97ab5a756d49265b327ff29babc400377a9187 | [
"MIT"
] | null | null | null | kahuna/config.py | esagecloudOS/kahuna-master | 0c97ab5a756d49265b327ff29babc400377a9187 | [
"MIT"
] | null | null | null | kahuna/config.py | esagecloudOS/kahuna-master | 0c97ab5a756d49265b327ff29babc400377a9187 | [
"MIT"
] | 3 | 2015-02-20T03:54:42.000Z | 2016-10-23T20:25:47.000Z | #!/usr/bin/env jython
import os
import logging
import shutil
import ConfigParser
from utils.singleton import singleton
log = logging.getLogger('kahuna')
log.setLevel(logging.INFO)
class ConfigLoader:
""" Loads configuration files from a given location """
def __init__(self, basedir="kahuna"):
""" In... | 34.1625 | 79 | 0.587999 |
1d47aadb54c09f2a3219cb2345aa9a542d5bb07e | 1,854 | py | Python | scripts/text_rank.py | Cyprestar/cail2019-1 | 924fb184451fa4ca0eb419a1dcc0bd6cea2edf3a | [
"Apache-2.0"
] | 2 | 2020-12-21T10:16:17.000Z | 2021-04-08T02:36:05.000Z | scripts/text_rank.py | Cyprestar/scm-fsim | 924fb184451fa4ca0eb419a1dcc0bd6cea2edf3a | [
"Apache-2.0"
] | null | null | null | scripts/text_rank.py | Cyprestar/scm-fsim | 924fb184451fa4ca0eb419a1dcc0bd6cea2edf3a | [
"Apache-2.0"
] | null | null | null | import torch
import numpy as np
import networkx as nx
from sklearn.metrics.pairwise import cosine_similarity
from transformers import BertTokenizer, BertModel
from flask import Flask, request
app = Flask(__name__)
model_dir = '../bert/ms'
tokenizer = BertTokenizer.from_pretrained(model_dir)
bert_model = BertModel.fr... | 33.709091 | 108 | 0.680151 |
033f902e22533e15702046a311ea95ec3205fa28 | 3,711 | py | Python | wordsum/read/utils/etl_wordsum.py | wordsum/wordsum2vec | 549f41a183210042834617ba49e505d164573445 | [
"OML"
] | null | null | null | wordsum/read/utils/etl_wordsum.py | wordsum/wordsum2vec | 549f41a183210042834617ba49e505d164573445 | [
"OML"
] | null | null | null | wordsum/read/utils/etl_wordsum.py | wordsum/wordsum2vec | 549f41a183210042834617ba49e505d164573445 | [
"OML"
] | null | null | null | import logging
'''
G E T D A T A F R O M W O R D S U M
'''
'''
Get and check the file state is it has all the data for the word2vec.
'''
def get_file_state(text_model):
logging.debug("Getting file state :")
if 'fileState' in text_model:
file_state = text_model['fileState']
else:
f... | 29.688 | 131 | 0.750202 |
4fc25436aee064b5ba2889accd969123b86fe685 | 1,848 | py | Python | var/spack/repos/builtin/packages/mathematica/package.py | robertsawko/spack | 135cf4835f5b646c4aaa0e2eb5552c80fc3a5ce8 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2019-11-28T10:14:14.000Z | 2019-11-28T10:14:14.000Z | var/spack/repos/builtin/packages/mathematica/package.py | robertsawko/spack | 135cf4835f5b646c4aaa0e2eb5552c80fc3a5ce8 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/mathematica/package.py | robertsawko/spack | 135cf4835f5b646c4aaa0e2eb5552c80fc3a5ce8 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2017-01-21T17:19:32.000Z | 2017-01-21T17:19:32.000Z | # 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 *
import os
class Mathematica(Package):
"""Mathematica: high-powered computation with thousands of... | 40.173913 | 112 | 0.66829 |
af27e495c900f374869e3c63085f93630f0339e7 | 9,382 | py | Python | run_deepsort.py | alaradirik/people-counting | c99c9eef7c63a52f59b4afcd5db81b39f2d6ef34 | [
"MIT"
] | 8 | 2020-07-10T15:46:04.000Z | 2021-07-15T19:35:13.000Z | run_deepsort.py | alaradirik/people-counting | c99c9eef7c63a52f59b4afcd5db81b39f2d6ef34 | [
"MIT"
] | 6 | 2020-10-02T13:30:03.000Z | 2021-10-21T07:49:58.000Z | run_deepsort.py | alaradirik/people-counting | c99c9eef7c63a52f59b4afcd5db81b39f2d6ef34 | [
"MIT"
] | 1 | 2021-05-15T23:58:36.000Z | 2021-05-15T23:58:36.000Z | import os
import time
import random
import cv2
import imutils
import dlib
import numpy as np
import tensorflow as tf
from utils import get_input_args, math_utils, file_utils
from utils import image_utils, model_utils
from trackers.deep_sort import preprocessing, nn_matching
from trackers.deep_sort.detection import D... | 34.748148 | 156 | 0.613622 |
541634062ff90882f6d03d8d14149fe76246ec1c | 8,367 | py | Python | isi_sdk_9_0_0/isi_sdk_9_0_0/models/cluster_config_onefs_version.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_9_0_0/isi_sdk_9_0_0/models/cluster_config_onefs_version.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_9_0_0/isi_sdk_9_0_0/models/cluster_config_onefs_version.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 10
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class ClusterConfigOnefsVersion... | 28.851724 | 133 | 0.586112 |
cc2b837cf53aa22fda7bfbe3c99ea3c6f21a998a | 13,546 | py | Python | src/train.py | parker84/BertSum | 23619b79e061e24b271e910c5b35b2048236891f | [
"Apache-2.0"
] | null | null | null | src/train.py | parker84/BertSum | 23619b79e061e24b271e910c5b35b2048236891f | [
"Apache-2.0"
] | null | null | null | src/train.py | parker84/BertSum | 23619b79e061e24b271e910c5b35b2048236891f | [
"Apache-2.0"
] | null | null | null | """
Main training workflow
"""
# print("printing environmental variables")
# print(os.system("env"))
# with open("./env.txt", "w") as f:
# f.write(os.system("env"))
# from __future__ import division
import os
from others.logging import logger, init_logger
init_logger("./test")
logger.info("printing environmen... | 36.316354 | 122 | 0.63133 |
78809ee4ed5f9efec49ccaf16f11d21cab00ab70 | 5,835 | py | Python | sdk/python/pulumi_oci/loadbalancer/get_load_balancer_routing_policy.py | EladGabay/pulumi-oci | 6841e27d4a1a7e15c672306b769912efbfd3ba99 | [
"ECL-2.0",
"Apache-2.0"
] | 5 | 2021-08-17T11:14:46.000Z | 2021-12-31T02:07:03.000Z | sdk/python/pulumi_oci/loadbalancer/get_load_balancer_routing_policy.py | pulumi-oci/pulumi-oci | 6841e27d4a1a7e15c672306b769912efbfd3ba99 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-09-06T11:21:29.000Z | 2021-09-06T11:21:29.000Z | sdk/python/pulumi_oci/loadbalancer/get_load_balancer_routing_policy.py | pulumi-oci/pulumi-oci | 6841e27d4a1a7e15c672306b769912efbfd3ba99 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2021-08-24T23:31:30.000Z | 2022-01-02T19:26:54.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** 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, overload
from .. import... | 40.241379 | 180 | 0.697515 |
713e9e20960a7245acd0bfddcc6881047094351d | 8,736 | py | Python | synthetic_data/run_generation.py | ntalabot/ROI_detection_DL | 135d2776e2ad09d40a0fe4ad6f7af40508c1fc06 | [
"MIT"
] | 1 | 2021-07-29T13:12:16.000Z | 2021-07-29T13:12:16.000Z | synthetic_data/run_generation.py | ntalabot/ROI_detection_DL | 135d2776e2ad09d40a0fe4ad6f7af40508c1fc06 | [
"MIT"
] | null | null | null | synthetic_data/run_generation.py | ntalabot/ROI_detection_DL | 135d2776e2ad09d40a0fe4ad6f7af40508c1fc06 | [
"MIT"
] | 1 | 2019-02-14T16:07:14.000Z | 2019-02-14T16:07:14.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Script to generate the synthetic dataset for the training.
See synthetic_generation.ipynb for more details.
Created on Thu Nov 22 10:01:56 2018
@author: nicolas
"""
import os, time
import warnings
import math
import numpy as np
import matplotlib.pyplot as plt
from s... | 42 | 114 | 0.61092 |
296113245cd95dc881c46773e1f056e12872ac4a | 23,459 | py | Python | page.py | ryanrdetzel/Mental-Cache | d29219d543ca2a0003dd2e0410d16d2f3f9f19c5 | [
"MIT"
] | 1 | 2020-04-14T13:28:38.000Z | 2020-04-14T13:28:38.000Z | page.py | ryanrdetzel/Mental-Cache | d29219d543ca2a0003dd2e0410d16d2f3f9f19c5 | [
"MIT"
] | null | null | null | page.py | ryanrdetzel/Mental-Cache | d29219d543ca2a0003dd2e0410d16d2f3f9f19c5 | [
"MIT"
] | null | null | null | import web
import os
import simplejson as json
import utils
import time
import textile
import re
from datetime import datetime
import logging
import pytc
urls = (
'/new_page','new_page',
'/([\w|-]+)/copy', 'copy',
'/([\w|-]+)/share', 'share',
'/([\w|-]+)/delete', 'delete',
'/([\w|-]+)/rename', 'ren... | 38.903814 | 126 | 0.470566 |
a588ea673a9c6d8b70082fc8f232357e04f953c7 | 1,979 | py | Python | project/preprocessing/method_vocab.py | dice-group/rich-context-competition | beeca49d760fb57e9d5ccf8330fc4c4003e11c06 | [
"BSD-2-Clause"
] | 2 | 2019-08-22T03:04:32.000Z | 2021-04-14T20:08:59.000Z | project/preprocessing/method_vocab.py | dice-group/rich-context-competition | beeca49d760fb57e9d5ccf8330fc4c4003e11c06 | [
"BSD-2-Clause"
] | 1 | 2020-08-12T05:52:24.000Z | 2020-08-12T05:52:24.000Z | project/preprocessing/method_vocab.py | dice-group/rich-context-competition | beeca49d760fb57e9d5ccf8330fc4c4003e11c06 | [
"BSD-2-Clause"
] | null | null | null | from project.preprocessing.preprocess_publications import PublicationPreprocessing
import json
class Helper_MethodExtractor:
"""
generates noun phrases for the methods vocabulary
"""
def __init__(self):
self.pp = PublicationPreprocessing()
def extract_np_for_dbpedia_vocab(self, path = "pro... | 30.921875 | 98 | 0.549773 |
23ebcb7e27abbb882593c2ca8ed1e0eb9c135880 | 6,505 | py | Python | oscar_mws/fulfillment/adapters.py | ButchershopCreative/django-oscar-mws | 582adc78f59578dbdf83d3ac145abc6bfc4a65ca | [
"BSD-3-Clause"
] | null | null | null | oscar_mws/fulfillment/adapters.py | ButchershopCreative/django-oscar-mws | 582adc78f59578dbdf83d3ac145abc6bfc4a65ca | [
"BSD-3-Clause"
] | null | null | null | oscar_mws/fulfillment/adapters.py | ButchershopCreative/django-oscar-mws | 582adc78f59578dbdf83d3ac145abc6bfc4a65ca | [
"BSD-3-Clause"
] | null | null | null | from decimal import Decimal as D
from collections import OrderedDict
from django.conf import settings
from ..utils import load_class, convert_camel_case
MWS_DEFAULT_SHIPPING_SPEED = getattr(settings, 'MWS_DEFAULT_SHIPPING_SPEED')
class BaseAdapter(object):
REQUIRED_FIELDS = []
OPTIONAL_FIELDS = []
def... | 31.887255 | 76 | 0.657494 |
de1b509f5d6d5e47cc2391f8c1b2c0b8d99452f1 | 409 | py | Python | src/gw_compas/wsgi.py | gravitationalwavedc/gwlandscape_compas | a9478f9d7b8dc5123dead18d7611c64572162557 | [
"MIT"
] | null | null | null | src/gw_compas/wsgi.py | gravitationalwavedc/gwlandscape_compas | a9478f9d7b8dc5123dead18d7611c64572162557 | [
"MIT"
] | null | null | null | src/gw_compas/wsgi.py | gravitationalwavedc/gwlandscape_compas | a9478f9d7b8dc5123dead18d7611c64572162557 | [
"MIT"
] | null | null | null | """
WSGI config for gwcloud_auth project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_... | 24.058824 | 80 | 0.792176 |
0440240ba1abc214d789ac638a41878786e2d8c7 | 2,321 | py | Python | dxlclient/_global_settings.py | freedai/opendxl-client-python | b6a5b216b4b9ba815a1b03e07755db563880881f | [
"Apache-2.0"
] | 110 | 2016-11-03T17:49:24.000Z | 2021-03-25T20:53:42.000Z | dxlclient/_global_settings.py | freedai/opendxl-client-python | b6a5b216b4b9ba815a1b03e07755db563880881f | [
"Apache-2.0"
] | 23 | 2016-11-04T17:08:13.000Z | 2021-12-03T19:30:53.000Z | dxlclient/_global_settings.py | freedai/opendxl-client-python | b6a5b216b4b9ba815a1b03e07755db563880881f | [
"Apache-2.0"
] | 63 | 2016-11-03T17:49:38.000Z | 2022-03-15T12:02:49.000Z | # -*- coding: utf-8 -*-
################################################################################
# Copyright (c) 2018 McAfee LLC - All Rights Reserved.
################################################################################
""" Global configuration functions. """
from __future__ import absolute_impor... | 21.896226 | 80 | 0.624731 |
527949a3fb74176d70b7c99476ed4e4eef3e8df7 | 4,393 | py | Python | setup.py | edekeijzer/OctoPrint-WebDavBackup | 81b82a031e001de90f64bff88bf8f47bf6498cb4 | [
"MIT"
] | 9 | 2021-01-18T02:46:42.000Z | 2022-01-03T22:23:10.000Z | setup.py | edekeijzer/OctoPrint-WebDavBackup | 81b82a031e001de90f64bff88bf8f47bf6498cb4 | [
"MIT"
] | 22 | 2021-01-17T21:56:26.000Z | 2022-02-24T08:20:18.000Z | setup.py | edekeijzer/OctoPrint-WebDavBackup | 81b82a031e001de90f64bff88bf8f47bf6498cb4 | [
"MIT"
] | 1 | 2021-03-09T20:20:45.000Z | 2021-03-09T20:20:45.000Z | # coding=utf-8
########################################################################################################################
### Do not forget to adjust the following variables to your own plugin.
# The plugin's identifier, has to be unique
plugin_identifier = "webdavbackup"
# The plugin's python package,... | 45.28866 | 140 | 0.714091 |
5bcb768318c07953479365f2090450b4520a34ad | 9,044 | py | Python | apps/read_grasps_from_file.py | Hymwgk/PointNetGPD | 0fa14ac88a573a3a72d62617aba1a195d19cb8d1 | [
"MIT"
] | 17 | 2021-02-01T07:40:34.000Z | 2022-03-23T07:31:14.000Z | dex-net/apps/read_grasps_from_file.py | henryhongyan/PointNetGPD | 93ac64696828b9e97f785e3c25784e1366b26e5c | [
"MIT"
] | 7 | 2021-04-08T14:58:53.000Z | 2022-03-24T02:58:00.000Z | dex-net/apps/read_grasps_from_file.py | henryhongyan/PointNetGPD | 93ac64696828b9e97f785e3c25784e1366b26e5c | [
"MIT"
] | 11 | 2021-03-09T06:34:37.000Z | 2022-03-23T07:31:23.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author : Hongzhuo Liang
# E-mail : liang@informatik.uni-hamburg.de
# Description:
# Date : 30/05/2018 9:57 AM
# File Name : read_grasps_from_file.py
# 使用python3
import os
import sys
import re
from meshpy.obj_file import ObjFile
from meshpy.sdf_file impor... | 37.065574 | 112 | 0.644184 |
090b375b1cc7e0ea8132e26172629bf47f3a432d | 77,681 | py | Python | conda_build/utils.py | njalerikson/conda-build | dd273df4e81905ab735ee03fd4467bae6e1dbd69 | [
"BSD-3-Clause"
] | null | null | null | conda_build/utils.py | njalerikson/conda-build | dd273df4e81905ab735ee03fd4467bae6e1dbd69 | [
"BSD-3-Clause"
] | null | null | null | conda_build/utils.py | njalerikson/conda-build | dd273df4e81905ab735ee03fd4467bae6e1dbd69 | [
"BSD-3-Clause"
] | null | null | null | from collections import OrderedDict, defaultdict
import contextlib
import fnmatch
import hashlib
import json
from locale import getpreferredencoding
import libarchive
import logging
import logging.config
import mmap
import operator
import os
from os.path import (dirname, getmtime, getsize, isdir, join, isfile, abspath,... | 36.728605 | 141 | 0.587338 |
8b81a3f82b224622f3e339acfab70e37a570e75b | 25,045 | py | Python | userbot/modules/chat.py | OdierBambi/Man-Userbot | ac67ee98623f12f7a8865439fe216bc48f4c2049 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2021-12-23T18:17:44.000Z | 2021-12-23T18:17:44.000Z | userbot/modules/chat.py | OdierBambi/Man-Userbot | ac67ee98623f12f7a8865439fe216bc48f4c2049 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/chat.py | OdierBambi/Man-Userbot | ac67ee98623f12f7a8865439fe216bc48f4c2049 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2022-01-18T05:11:17.000Z | 2022-01-18T05:11:17.000Z | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
""" Userbot module containing userid, chatid and log commands"""
import asyncio
import csv
import random
from asyncio im... | 36.297101 | 150 | 0.606069 |
35da2e93bfededc4a97d48654b20afa9657ad7fc | 2,167 | py | Python | src/python/weblyzard_api/tests/always_run/model/test_char_spans.py | weblyzard/weblyzard_api | 69782b39beba3b068e40d15119192f4d33fae092 | [
"Apache-2.0"
] | 9 | 2015-07-13T08:16:55.000Z | 2020-03-17T12:06:25.000Z | src/python/weblyzard_api/tests/always_run/model/test_char_spans.py | weblyzard/weblyzard_api | 69782b39beba3b068e40d15119192f4d33fae092 | [
"Apache-2.0"
] | 40 | 2015-03-11T22:59:51.000Z | 2022-03-25T21:47:07.000Z | src/python/weblyzard_api/tests/always_run/model/test_char_spans.py | weblyzard/weblyzard_api | 69782b39beba3b068e40d15119192f4d33fae092 | [
"Apache-2.0"
] | 5 | 2016-02-11T15:19:16.000Z | 2020-02-06T09:47:24.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
Created on September 11, 2019
@author: jakob <jakob.steixner@modul.ac.at>
'''
import unittest
import pytest
from weblyzard_api.model import SpanFactory, CharSpan, TokenCharSpan, \
SentimentCharSpan, SentenceCharSpan
class TestSpanFactory(unittest.TestCase):
de... | 42.490196 | 84 | 0.610521 |
5ac95e23809e4cf079044edcab97755bb603191a | 1,629 | py | Python | Examples/Python/pcbusb_recv.py | mac-can/PCBUSB-Linrary | f38a8c10c86d8b9938231713cdb6d6258e38c75e | [
"Intel"
] | null | null | null | Examples/Python/pcbusb_recv.py | mac-can/PCBUSB-Linrary | f38a8c10c86d8b9938231713cdb6d6258e38c75e | [
"Intel"
] | null | null | null | Examples/Python/pcbusb_recv.py | mac-can/PCBUSB-Linrary | f38a8c10c86d8b9938231713cdb6d6258e38c75e | [
"Intel"
] | null | null | null | from PCANBasic import * ## PCAN-Basic library import
import string ## String functions
import time ## Time-related library
import select ## Waiting for I/O completion
import signal ## Set handlers for asynchronous events
import sys ... | 30.166667 | 125 | 0.60221 |
5bd975356b3d6f77e9a5d73b3795e4dc172a2b59 | 1,026 | py | Python | backend/music/utils.py | findyourtune/findyourtune | d27d608e003728ee16f1f09d9233ab9cf1c7a4c3 | [
"MIT"
] | 2 | 2021-01-13T02:32:45.000Z | 2021-01-14T20:55:51.000Z | backend/music/utils.py | findyourtune/findyourtune | d27d608e003728ee16f1f09d9233ab9cf1c7a4c3 | [
"MIT"
] | 3 | 2021-01-29T16:14:49.000Z | 2021-03-19T04:22:20.000Z | backend/music/utils.py | findyourtune/findyourtune | d27d608e003728ee16f1f09d9233ab9cf1c7a4c3 | [
"MIT"
] | null | null | null | # Grabbing some important information to display
def get_track_obj(track):
return {
'name': track['name'],
'images': track['album']['images'],
'artist': track['artists'][0],
'popularity': track['popularity'],
'url': track['external_urls']['spotify'],
'item_id': track[... | 27.72973 | 49 | 0.530214 |
f7d223d1806ad378c85dfce0669f35f4e92702ee | 38,286 | py | Python | survivalbox/game_objects.py | JohannesTheo/SurvivalBox | e4d4c754bdc28961dc5e8fa5ce74eb1875f043e3 | [
"MIT"
] | null | null | null | survivalbox/game_objects.py | JohannesTheo/SurvivalBox | e4d4c754bdc28961dc5e8fa5ce74eb1875f043e3 | [
"MIT"
] | null | null | null | survivalbox/game_objects.py | JohannesTheo/SurvivalBox | e4d4c754bdc28961dc5e8fa5ce74eb1875f043e3 | [
"MIT"
] | null | null | null | __author__ = 'Johannes Theodoridis'
# standard imports
import os
import copy
# third party imports
import numpy as np
import pygame
from pygame import K_UP, K_DOWN, K_LEFT, K_RIGHT, K_COMMA, K_PERIOD, K_F15
# local imports
from . import map
from . import utils
MANUAL=False
#RANDOM=False
RANDOM_NPC=False
# orientat... | 40.090052 | 147 | 0.54422 |
5f8c3682e94176d03bd85cd6a7f0d155dae0c038 | 15,541 | py | Python | qemu-shack-ibtc/roms/seabios/tools/layoutrom.py | silverneko/HWs | 84d19316e01c3bb7b2fcf1fa9ad3dff99c01b543 | [
"MIT"
] | null | null | null | qemu-shack-ibtc/roms/seabios/tools/layoutrom.py | silverneko/HWs | 84d19316e01c3bb7b2fcf1fa9ad3dff99c01b543 | [
"MIT"
] | null | null | null | qemu-shack-ibtc/roms/seabios/tools/layoutrom.py | silverneko/HWs | 84d19316e01c3bb7b2fcf1fa9ad3dff99c01b543 | [
"MIT"
] | 1 | 2018-05-15T00:12:19.000Z | 2018-05-15T00:12:19.000Z | #!/usr/bin/env python
# Script to analyze code and arrange ld sections.
#
# Copyright (C) 2008 Kevin O'Connor <kevin@koconnor.net>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
import sys
# LD script headers/trailers
COMMONHEADER = """
/* DO NOT EDIT! This is an autogenerated file. See... | 35.562929 | 79 | 0.57892 |
2472d9101d98bb8e126421641ebb8d1ee4ac07fe | 3,564 | py | Python | build_fira_emacs.py | joranvar/fira-code-emacs | 71b35183584f483e1d5957fa547e26c496eb6000 | [
"Apache-2.0"
] | null | null | null | build_fira_emacs.py | joranvar/fira-code-emacs | 71b35183584f483e1d5957fa547e26c496eb6000 | [
"Apache-2.0"
] | null | null | null | build_fira_emacs.py | joranvar/fira-code-emacs | 71b35183584f483e1d5957fa547e26c496eb6000 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python3
from fontTools.ttLib import TTFont
import io
import os
import re
import sys
import xml.etree.ElementTree as ET
def ElispLiteral(s):
return '"' + s.replace("\\", "\\\\").replace('"', '\\"') + '"'
class Glyph:
def __init__(self, **kw):
self.__dict__.update(kw)
def Main():
... | 32.108108 | 87 | 0.597924 |
2fa615fb9c0b86f1eca7f45ba3ba06a9c2170789 | 3,971 | py | Python | src/mach/yaml.py | jeroenubbink/mach-composer | cfd43ddafc8650e6c1debc6b8ad22bd326178808 | [
"MIT"
] | 16 | 2021-05-12T12:54:35.000Z | 2022-03-15T23:47:54.000Z | src/mach/yaml.py | jeroenubbink/mach-composer | cfd43ddafc8650e6c1debc6b8ad22bd326178808 | [
"MIT"
] | 27 | 2021-05-21T12:37:32.000Z | 2022-03-28T10:18:38.000Z | src/mach/yaml.py | jeroenubbink/mach-composer | cfd43ddafc8650e6c1debc6b8ad22bd326178808 | [
"MIT"
] | 2 | 2021-05-12T12:54:34.000Z | 2021-07-12T07:21:50.000Z | import io
import os
import re
import subprocess
import tempfile
from contextlib import contextmanager
from os.path import abspath, dirname
from typing import Tuple, Union
import click
import requests
import yaml
import yamlinclude
from mach import exceptions, git
from yaml.error import YAMLError # noqa
EXTERNAL_RE =... | 28.364286 | 90 | 0.64417 |
af1f17c76d44000dd2ea3ccdd8b4e4badc93a98f | 14,863 | py | Python | kb/bert_tokenizer_and_candidate_generator.py | gpiat/kb | 049145ac8be678d50f611317ab779a4c2f5adcb7 | [
"Apache-2.0"
] | null | null | null | kb/bert_tokenizer_and_candidate_generator.py | gpiat/kb | 049145ac8be678d50f611317ab779a4c2f5adcb7 | [
"Apache-2.0"
] | null | null | null | kb/bert_tokenizer_and_candidate_generator.py | gpiat/kb | 049145ac8be678d50f611317ab779a4c2f5adcb7 | [
"Apache-2.0"
] | null | null | null | import copy
from typing import Dict
from typing import List
from typing import Sequence
import numpy as np
from allennlp.data import Token
from allennlp.data.fields import ArrayField
from allennlp.data.fields import Field
from allennlp.data.fields import ListField
from allennlp.data.fields import SpanField
from alle... | 43.843658 | 121 | 0.623696 |
6804a37dd519b8c7518d1a699e4ee6b730664316 | 2,454 | py | Python | src/oci/service_mesh/models/change_ingress_gateway_compartment_details.py | pabs3/oci-python-sdk | 437ba18ce39af2d1090e277c4bb8750c89f83021 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/service_mesh/models/change_ingress_gateway_compartment_details.py | pabs3/oci-python-sdk | 437ba18ce39af2d1090e277c4bb8750c89f83021 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/service_mesh/models/change_ingress_gateway_compartment_details.py | pabs3/oci-python-sdk | 437ba18ce39af2d1090e277c4bb8750c89f83021 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 32.72 | 245 | 0.689894 |
7f2fbf20d1d71d408c87f73e2b8e85ffc1f98e51 | 553 | py | Python | backend/project/celery.py | PythonicNinja/pymosaico | 9a0b1a82aad23adb496944ef09609208585ac3ee | [
"MIT"
] | 1 | 2016-12-15T06:10:45.000Z | 2016-12-15T06:10:45.000Z | backend/project/celery.py | PythonicNinja/pymosaico | 9a0b1a82aad23adb496944ef09609208585ac3ee | [
"MIT"
] | null | null | null | backend/project/celery.py | PythonicNinja/pymosaico | 9a0b1a82aad23adb496944ef09609208585ac3ee | [
"MIT"
] | null | null | null | from __future__ import absolute_import
# -*- coding: utf-8 -*-
# CREATED ON DATE: 11.05.2016
__author__ = 'mail@pythonic.ninja'
import os
from celery import Celery
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'project.settings')
from django.conf... | 23.041667 | 67 | 0.759494 |
412e63cf84808f931af1902999349ef87345762c | 61,411 | py | Python | octavia/tests/unit/common/jinja/haproxy/combined_listeners/test_jinja_cfg.py | xilousonw/octavia | 2bdc7a6e08b5e6f4197f45c22a3b9e42363c0ed2 | [
"Apache-2.0"
] | null | null | null | octavia/tests/unit/common/jinja/haproxy/combined_listeners/test_jinja_cfg.py | xilousonw/octavia | 2bdc7a6e08b5e6f4197f45c22a3b9e42363c0ed2 | [
"Apache-2.0"
] | null | null | null | octavia/tests/unit/common/jinja/haproxy/combined_listeners/test_jinja_cfg.py | xilousonw/octavia | 2bdc7a6e08b5e6f4197f45c22a3b9e42363c0ed2 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 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... | 49.605008 | 78 | 0.584667 |
df9f223d40254ca13a698acf563cf9abff7db004 | 223 | py | Python | saleor/page/utils.py | adonig/saleor | 41f2148da45acd8309faeda5331ca5fc93a0d201 | [
"BSD-3-Clause"
] | 6 | 2019-01-06T08:39:20.000Z | 2022-03-04T18:07:47.000Z | saleor/page/utils.py | adonig/saleor | 41f2148da45acd8309faeda5331ca5fc93a0d201 | [
"BSD-3-Clause"
] | 64 | 2019-02-11T17:02:05.000Z | 2021-06-25T15:16:57.000Z | saleor/page/utils.py | adonig/saleor | 41f2148da45acd8309faeda5331ca5fc93a0d201 | [
"BSD-3-Clause"
] | 2 | 2019-01-08T02:32:42.000Z | 2021-07-05T14:05:55.000Z | from .models import Page
def pages_visible_to_user(user):
qs = Page.objects.prefetch_related('translations')
if user.is_authenticated and user.is_active and user.is_staff:
return qs
return qs.public()
| 24.777778 | 66 | 0.735426 |
bb7e4917e38eb21fca806c7697df64acab98c7e7 | 1,320 | py | Python | tools/fuchsia/parse_manifest.py | ModProg/engine | 93cb5dbbc70092b5c675ebf53fde7dea39086382 | [
"BSD-3-Clause"
] | 4 | 2018-04-11T08:45:50.000Z | 2021-12-16T15:48:01.000Z | tools/fuchsia/parse_manifest.py | christopherfujino/engine | 14c3686153b1af6d8766aebd20a3c1b0d795ac77 | [
"BSD-3-Clause"
] | 1 | 2020-08-04T09:00:33.000Z | 2020-08-04T09:00:33.000Z | tools/fuchsia/parse_manifest.py | christopherfujino/engine | 14c3686153b1af6d8766aebd20a3c1b0d795ac77 | [
"BSD-3-Clause"
] | 9 | 2021-03-11T04:52:17.000Z | 2021-12-17T09:19:06.000Z | #!/usr/bin/env python
#
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Parses manifest file and dumps it to json.
"""
import argparse
import json
import os
import sys
import hashlib
def main():
pars... | 25.882353 | 72 | 0.653788 |
3cd29278fc3ec16078e221bcebb8494ce8ce6fd2 | 1,419 | py | Python | molecule/with-config/tests/test_default.py | kitos9112/ansible-role-adguardhome | ef383a75099e87d9e029da4303c8e3cce908d50d | [
"MIT"
] | 6 | 2020-01-18T09:17:32.000Z | 2022-02-10T02:09:02.000Z | molecule/with-config/tests/test_default.py | kitos9112/ansible-role-adguardhome | ef383a75099e87d9e029da4303c8e3cce908d50d | [
"MIT"
] | null | null | null | molecule/with-config/tests/test_default.py | kitos9112/ansible-role-adguardhome | ef383a75099e87d9e029da4303c8e3cce908d50d | [
"MIT"
] | 1 | 2021-02-01T19:57:57.000Z | 2021-02-01T19:57:57.000Z | import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_adguardhome_config_dir(host):
d = host.file('/opt/adguardhome/config')
assert d.exists
assert d.is_directory
assert d.... | 21.5 | 63 | 0.689922 |
661f758c16e1325654e68ab62ec150ba1154a04b | 1,008 | py | Python | covertrace/utils/ktr_shuttle_ode.py | braysia/covertrace | cb3f91964bd7b524eb10bfce972136eb921ab689 | [
"MIT"
] | 1 | 2021-03-09T07:39:56.000Z | 2021-03-09T07:39:56.000Z | covertrace/utils/ktr_shuttle_ode.py | braysia/covertrace | cb3f91964bd7b524eb10bfce972136eb921ab689 | [
"MIT"
] | null | null | null | covertrace/utils/ktr_shuttle_ode.py | braysia/covertrace | cb3f91964bd7b524eb10bfce972136eb921ab689 | [
"MIT"
] | 5 | 2016-09-26T00:41:39.000Z | 2018-04-03T23:31:05.000Z | import numpy as np
class ParamHolder(object):
__slots__ = ['k_v', 'k_iu', 'k_eu', 'k_ip', 'k_ep',
'k_cat', 'Km', 'k_dc', 'k_dn', 'Kmd', 'r_total',
'time_points', 'kin_c_with_time', 'kin_n_with_time']
def __init__(self, dict_params):
for i, ii in dict_params.iteritems... | 37.333333 | 77 | 0.547619 |
5c4f539974299ae63786534479c486edc5fbf3ef | 1,471 | py | Python | gen_raise/gendata_jp2_compression.py | cpra/oiqa-cnns | c662f952b5914709ef1831000eda5640f179654f | [
"Zlib"
] | 2 | 2017-08-09T03:13:16.000Z | 2017-10-27T06:11:42.000Z | gen_raise/gendata_jp2_compression.py | cpra/oiqa-cnns | c662f952b5914709ef1831000eda5640f179654f | [
"Zlib"
] | null | null | null | gen_raise/gendata_jp2_compression.py | cpra/oiqa-cnns | c662f952b5914709ef1831000eda5640f179654f | [
"Zlib"
] | null | null | null |
'''
Extract images affected with JP2K compression artefacts.
~ Christopher Pramerdorfer
'''
import cv2
import os
import subprocess
src = '/mnt/storage/datasets/image-manipulation/RAISE/RAISE20-1300-1337/images'
src_imext = '.png'
dst_root = '/mnt/storage/datasets/image-manipulation/RAISE/RAISE20-1300-1337/images-j... | 22.984375 | 95 | 0.602311 |
7415b4fd8ba6f4481e19b24e6225dc77bd24bbb7 | 949 | py | Python | src/wellsfargo/security/__init__.py | robertdev5/django-oscar | 35c8554c988ad3a901de1d4772c4372c190df1e3 | [
"0BSD"
] | null | null | null | src/wellsfargo/security/__init__.py | robertdev5/django-oscar | 35c8554c988ad3a901de1d4772c4372c190df1e3 | [
"0BSD"
] | 8 | 2021-03-18T22:26:27.000Z | 2022-02-10T11:28:57.000Z | src/wellsfargo/security/__init__.py | supertech-999/django-oscar | 35c8554c988ad3a901de1d4772c4372c190df1e3 | [
"0BSD"
] | null | null | null | from django.core.exceptions import ImproperlyConfigured
from ..settings import WFRS_SECURITY
import importlib
def encrypt_account_number(account_number):
klass = WFRS_SECURITY['encryptor']
kwargs = WFRS_SECURITY.get('encryptor_kwargs', {})
return _get_encryptor(klass, kwargs).encrypt(account_number)
def... | 30.612903 | 84 | 0.741834 |
6cca492e0d92fc370f770f10fa31dd953a0956f4 | 1,540 | py | Python | bpexts/cvp/tanh.py | f-dangel/hbp | 3ed208ce16fae1c2697e1d5220de91205e1d13c3 | [
"MIT"
] | 13 | 2020-02-27T00:24:27.000Z | 2022-01-09T05:35:46.000Z | bpexts/cvp/tanh.py | f-dangel/hbp | 3ed208ce16fae1c2697e1d5220de91205e1d13c3 | [
"MIT"
] | 5 | 2021-06-08T21:00:04.000Z | 2022-03-12T00:17:39.000Z | bpexts/cvp/tanh.py | f-dangel/hbp | 3ed208ce16fae1c2697e1d5220de91205e1d13c3 | [
"MIT"
] | 2 | 2020-09-10T03:34:07.000Z | 2022-01-09T05:35:50.000Z | """Elementwise Tanh activation function with CVP functionality."""
from torch.nn import Tanh
from .nonlinear import cvp_elementwise_nonlinear
class CVPTanh(cvp_elementwise_nonlinear(Tanh)):
"""Componentwise tanh layer with CVP functionality.
Applies tanh(x) = (exp(x) - exp(-x)) / (exp(x) + exp(-x)) element... | 32.083333 | 79 | 0.645455 |
2a096086df08857123b8f1ac4a9f5a87a115f870 | 10,318 | py | Python | userbot/modules/hacking.py | brut69/Hexxa-Userbot | 0fbd633159e54c64394ebe66a17ea6131f4be631 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 5 | 2021-08-13T05:17:12.000Z | 2021-11-15T12:12:47.000Z | userbot/modules/hacking.py | brut69/Hexxa-Userbot | 0fbd633159e54c64394ebe66a17ea6131f4be631 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 62 | 2021-09-02T22:18:59.000Z | 2022-03-28T22:22:10.000Z | userbot/modules/hacking.py | brut69/Hexxa-Userbot | 0fbd633159e54c64394ebe66a17ea6131f4be631 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 8 | 2021-08-14T19:49:16.000Z | 2021-08-24T03:47:11.000Z | # (C) Copyright 2021 Hexxa-Userbot LLC Company
# GPL-3.0 License From Github
# Credits by @TeamUltroid, Kraken, Sawan.
from userbot import CMD_HELP
from userbot.events import register
import asyncio
@register(outgoing=True, pattern='^.hacking(?: |$)(.*)')
async def hack(event):
range(0, 11)
await event.edi... | 80.609375 | 494 | 0.672805 |
c16643613e974840ac925a31cb6812cd59d2eee1 | 7,468 | py | Python | core/dbt/version.py | tomasfarias/dbt-core | ed5df342ca5d99c5e6971ee6d11c8cf3e6e263b3 | [
"Apache-2.0"
] | 799 | 2021-10-13T21:40:33.000Z | 2022-03-31T16:19:31.000Z | core/dbt/version.py | tomasfarias/dbt-core | ed5df342ca5d99c5e6971ee6d11c8cf3e6e263b3 | [
"Apache-2.0"
] | 939 | 2021-10-13T17:45:24.000Z | 2022-03-31T22:09:58.000Z | core/dbt/version.py | tomasfarias/dbt-core | ed5df342ca5d99c5e6971ee6d11c8cf3e6e263b3 | [
"Apache-2.0"
] | 175 | 2021-10-14T18:59:06.000Z | 2022-03-31T16:17:32.000Z | import importlib
import importlib.util
import os
import glob
import json
from typing import Iterator, List, Optional, Tuple
import requests
import dbt.exceptions
import dbt.semver
from dbt.ui import green, red, yellow
from dbt import flags
PYPI_VERSION_URL = "https://pypi.org/pypi/dbt-core/json"
def get_version_i... | 31.246862 | 90 | 0.643948 |
fb15013b9616b51d0fcd6d1eb6422223d26831df | 3,407 | py | Python | src/rubrix/sdk/models/token_classification_bulk_data.py | drahnreb/rubrix | 340e545baf4d65a0d94e3c671ad6c93ff1d59700 | [
"Apache-2.0"
] | null | null | null | src/rubrix/sdk/models/token_classification_bulk_data.py | drahnreb/rubrix | 340e545baf4d65a0d94e3c671ad6c93ff1d59700 | [
"Apache-2.0"
] | null | null | null | src/rubrix/sdk/models/token_classification_bulk_data.py | drahnreb/rubrix | 340e545baf4d65a0d94e3c671ad6c93ff1d59700 | [
"Apache-2.0"
] | null | null | null | from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from ..models.creation_token_classification_record import (
CreationTokenClassificationRecord,
)
from ..models.token_classification_bulk_data_metadata import (
TokenClassificationBulkDataMetadata,
)
from ..models.token_classification_bulk_da... | 31.841121 | 88 | 0.659231 |
b905274eb6c9f1cd77d61e877320000601749264 | 2,015 | py | Python | pocs/scheduler/field.py | zacharyt20/POCS | 8f785eaf27178be7d72106cb82e5400a8b852ba8 | [
"MIT"
] | 1 | 2019-07-19T10:37:08.000Z | 2019-07-19T10:37:08.000Z | pocs/scheduler/field.py | zacharyt20/POCS | 8f785eaf27178be7d72106cb82e5400a8b852ba8 | [
"MIT"
] | null | null | null | pocs/scheduler/field.py | zacharyt20/POCS | 8f785eaf27178be7d72106cb82e5400a8b852ba8 | [
"MIT"
] | null | null | null | from astroplan import FixedTarget
from astropy.coordinates import SkyCoord
from pocs.base import PanBase
class Field(FixedTarget, PanBase):
def __init__(self, name, position, equinox='J2000', **kwargs):
""" An object representing an area to be observed
A `Field` corresponds to an `~astroplan.Ob... | 34.741379 | 98 | 0.441191 |
868faa0df1f2ab0142f5386da4254f4dc0d2861e | 617 | py | Python | airbyte-integrations/connectors/source-outreach/setup.py | onaio/airbyte | 38302e82a25f1b66742c3febfbff0668556920f2 | [
"MIT"
] | 22 | 2020-08-27T00:47:20.000Z | 2020-09-17T15:39:39.000Z | airbyte-integrations/connectors/source-outreach/setup.py | onaio/airbyte | 38302e82a25f1b66742c3febfbff0668556920f2 | [
"MIT"
] | 116 | 2020-08-27T01:11:27.000Z | 2020-09-19T02:47:52.000Z | airbyte-integrations/connectors/source-outreach/setup.py | onaio/airbyte | 38302e82a25f1b66742c3febfbff0668556920f2 | [
"MIT"
] | 1 | 2020-09-15T06:10:01.000Z | 2020-09-15T06:10:01.000Z | #
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
#
from setuptools import find_packages, setup
MAIN_REQUIREMENTS = [
"airbyte-cdk",
]
TEST_REQUIREMENTS = [
"pytest~=6.1",
"pytest-mock~=3.6.1",
"source-acceptance-test",
]
setup(
name="source_outreach",
description="Source implement... | 20.566667 | 77 | 0.656402 |
bf78560003d5087d5eb85b96b282564d64b67ad7 | 8,557 | py | Python | pyfacebook/models/ig_business_models.py | sns-sdks/python-facebook | 9536d30393dee8b2a887b81f103d76262a677eee | [
"Apache-2.0"
] | 181 | 2019-08-28T10:03:49.000Z | 2022-03-26T19:36:05.000Z | pyfacebook/models/ig_business_models.py | sns-sdks/python-facebook | 9536d30393dee8b2a887b81f103d76262a677eee | [
"Apache-2.0"
] | 159 | 2019-08-28T10:07:43.000Z | 2022-03-30T16:42:23.000Z | pyfacebook/models/ig_business_models.py | sns-sdks/python-facebook | 9536d30393dee8b2a887b81f103d76262a677eee | [
"Apache-2.0"
] | 40 | 2019-09-10T20:12:47.000Z | 2022-03-12T16:16:46.000Z | """
Model classes for instagram business.
"""
from dataclasses import dataclass
from typing import List, Optional, Union
from pyfacebook.models.base import BaseModel, field
from pyfacebook.models.extensions import Paging
@dataclass
class IgBusUser(BaseModel):
"""
A class representing the Business User.
... | 27.338658 | 114 | 0.704686 |
bf0a36e43dcaf5d850bd012176403888118c2c83 | 4,390 | py | Python | fortimailapi/fortimailapi.py | fortinet-solutions-cse/fortimailapi | ce868ce936628be1060f42b2dd5713b796f2fc65 | [
"Apache-2.0"
] | null | null | null | fortimailapi/fortimailapi.py | fortinet-solutions-cse/fortimailapi | ce868ce936628be1060f42b2dd5713b796f2fc65 | [
"Apache-2.0"
] | 1 | 2019-06-10T16:31:33.000Z | 2019-06-10T16:31:33.000Z | fortimailapi/fortimailapi.py | fortinet-solutions-cse/fortimailapi | ce868ce936628be1060f42b2dd5713b796f2fc65 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2017 Fortinet, 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 require... | 32.518519 | 77 | 0.613212 |
a0e779bd92ff0ba9cc528a4bbc340cdedd2be394 | 3,697 | py | Python | tests/test_debug.py | aklajnert/jinja | 8d85f9cb6b7617e62cc07dcd7f022b10027b5dab | [
"BSD-3-Clause"
] | null | null | null | tests/test_debug.py | aklajnert/jinja | 8d85f9cb6b7617e62cc07dcd7f022b10027b5dab | [
"BSD-3-Clause"
] | null | null | null | tests/test_debug.py | aklajnert/jinja | 8d85f9cb6b7617e62cc07dcd7f022b10027b5dab | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import pickle
import re
from traceback import format_exception
import pytest
from jinja import ChoiceLoader
from jinja import DictLoader
from jinja import Environment
from jinja import TemplateSyntaxError
@pytest.fixture
def fs_env(filesystem_loader):
"""returns a new environment."""
... | 31.330508 | 88 | 0.600487 |
0515a0354b886867784ff09b9e99bed3e67b8b87 | 5,061 | py | Python | src/opnsense/scripts/unbound/wrapper.py | johnaheadley/core | 7d3188671c1f2b532919d380dfcd06f6ce8d2ddf | [
"BSD-2-Clause"
] | null | null | null | src/opnsense/scripts/unbound/wrapper.py | johnaheadley/core | 7d3188671c1f2b532919d380dfcd06f6ce8d2ddf | [
"BSD-2-Clause"
] | null | null | null | src/opnsense/scripts/unbound/wrapper.py | johnaheadley/core | 7d3188671c1f2b532919d380dfcd06f6ce8d2ddf | [
"BSD-2-Clause"
] | null | null | null | #!/usr/local/bin/python3
"""
Copyright (c) 2017 Ad Schellevis <ad@opnsense.org>
Copyright (C) 2017 Fabian Franz
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistribution... | 41.146341 | 119 | 0.621814 |
9a6f8448e56bca128c7fa2de2947ff9606e0b416 | 1,745 | py | Python | flask_online_store/models/user.py | friendly-of-python/flask-online-store | 06df0c2ac5c0cf3e2e0b2a45a141a3125b43f8cb | [
"MIT"
] | 20 | 2016-12-02T04:01:20.000Z | 2021-03-03T03:35:17.000Z | flask_online_store/models/user.py | sunhuachuang/flask-online-store | 06df0c2ac5c0cf3e2e0b2a45a141a3125b43f8cb | [
"MIT"
] | 2 | 2016-12-02T04:03:51.000Z | 2019-03-30T10:11:21.000Z | flask_online_store/models/user.py | friendly-of-python/flask-online-store | 06df0c2ac5c0cf3e2e0b2a45a141a3125b43f8cb | [
"MIT"
] | 6 | 2016-12-03T07:10:18.000Z | 2018-05-25T09:28:07.000Z | from . import db, addTimeToModel
from ..utils.encrypt import encrypt
@addTimeToModel
class User(db.Model):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(80), unique=True, nullable=False)
email = db.Column(db.String(80), nullable=False)
passwor... | 27.698413 | 76 | 0.618338 |
b5f965fa1a8e9d01c04da45c8f0fa71230b43c38 | 2,634 | py | Python | projects/codecs/Python/examples/skeleton/skeleton_environment.py | sakaimiho/rl-glue-ext | 914b039849544a042f138cea2aa28c2b4af1b049 | [
"Apache-2.0"
] | 5 | 2016-04-18T04:45:36.000Z | 2020-10-12T19:12:25.000Z | projects/codecs/Python/examples/skeleton/skeleton_environment.py | cameron-upright/rl-glue-ext | 914b039849544a042f138cea2aa28c2b4af1b049 | [
"Apache-2.0"
] | null | null | null | projects/codecs/Python/examples/skeleton/skeleton_environment.py | cameron-upright/rl-glue-ext | 914b039849544a042f138cea2aa28c2b4af1b049 | [
"Apache-2.0"
] | 3 | 2016-11-24T04:08:53.000Z | 2020-11-16T19:59:24.000Z | #
# Copyright (C) 2007, Mark Lee
#
#http://rl-glue-ext.googlecode.com/
#
# 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... | 29.266667 | 188 | 0.744875 |
46e0e6f7286dc09a58fbfdf8c579e099a823a116 | 1,597 | py | Python | ckan/lib/extract.py | doc22940/ckan | fb0174b77a5ac1c614717643d9b1b2a0c82ee088 | [
"Apache-2.0"
] | 1 | 2020-08-05T21:21:56.000Z | 2020-08-05T21:21:56.000Z | ckan/lib/extract.py | doc22940/ckan | fb0174b77a5ac1c614717643d9b1b2a0c82ee088 | [
"Apache-2.0"
] | null | null | null | ckan/lib/extract.py | doc22940/ckan | fb0174b77a5ac1c614717643d9b1b2a0c82ee088 | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
import re
from jinja2.ext import babel_extract as extract_jinja2
import ckan.lib.jinja_extensions
from six import string_types
jinja_extensions = '''
jinja2.ext.do, jinja2.ext.with_,
ckan.lib.jinja_extensions.SnippetExtension,
ckan.lib.jinj... | 35.488889 | 77 | 0.650595 |
63baf29e342f88ba1b433384050a58417b6df939 | 10,731 | py | Python | chirun/plastex/ifthen.py | sthagen/chirun-ncl-chirun | 45897319d5203b9867b5d6e00b2db1aa90a6580c | [
"Apache-2.0"
] | 5 | 2021-12-06T15:57:24.000Z | 2022-01-24T20:34:00.000Z | chirun/plastex/ifthen.py | sthagen/chirun-ncl-chirun | 45897319d5203b9867b5d6e00b2db1aa90a6580c | [
"Apache-2.0"
] | 38 | 2021-12-09T13:16:46.000Z | 2022-03-30T11:42:13.000Z | chirun/plastex/ifthen.py | sthagen/chirun-ncl-chirun | 45897319d5203b9867b5d6e00b2db1aa90a6580c | [
"Apache-2.0"
] | 1 | 2022-01-17T17:41:35.000Z | 2022-01-17T17:41:35.000Z | """
A Python implementation of the ifthen package.
"""
from plasTeX import Command, TeXFragment, number
from plasTeX.Tokenizer import Token, Space
from typing import Union, List
class BeginMath(Command):
macroName = '('
catcode = None
disableMath: bool = False
def invoke(self, tex):
if sel... | 31.9375 | 87 | 0.557171 |
e7ffaa6ab58ff73b08a2d237298abfee6c61566c | 430 | py | Python | app/config.py | rashidaysher/rashmed | 6118448547ff85082dc271911812e7f7df111938 | [
"MIT"
] | null | null | null | app/config.py | rashidaysher/rashmed | 6118448547ff85082dc271911812e7f7df111938 | [
"MIT"
] | null | null | null | app/config.py | rashidaysher/rashmed | 6118448547ff85082dc271911812e7f7df111938 | [
"MIT"
] | null | null | null | from app.models import articles
class Config:
"""
General configaration parent class
"""
NEWS_SOURCES_API_BASE_URL = 'https://newsapi.org/v2/sources?language=en&category={}&apiKey={}'
EVERYTHING_SOURCE_API_URL= 'https://newsapi.org/v2/everything?q={}&apiKey={}'
class ProdConfig(Config):... | 18.695652 | 98 | 0.660465 |
a3aa25bbe94f6ea9bbcdf0e55c64296baba6a4dd | 1,765 | py | Python | tutorial18.py | cizkey/PythonOpenCVPractice | 3fa4fb6182cdd2cc22fca6b31967b7a026b0985e | [
"MIT"
] | null | null | null | tutorial18.py | cizkey/PythonOpenCVPractice | 3fa4fb6182cdd2cc22fca6b31967b7a026b0985e | [
"MIT"
] | null | null | null | tutorial18.py | cizkey/PythonOpenCVPractice | 3fa4fb6182cdd2cc22fca6b31967b7a026b0985e | [
"MIT"
] | null | null | null | # 基于dlib的face detection, eye detection
# dlib的检测比使用opencv的人脸检测更加精准和强大
### 重要说明
# 安装dlib
# 首先确保python版本为3.6,从https://pypi.org/simple/dlib/下载dlib-19.8.1-cp36-cp36m-win_amd64.whl,
# 然后使用pip install dlib-19.8.1-cp36-cp36m-win_amd64.whl命令安装
# 准备人脸关键点模型
# 从http://dlib.net/files/下载shape_predictor_68_fac... | 26.343284 | 94 | 0.686686 |
7e29ef3c527f7ec40b16618b0c96a07a7d125e23 | 885 | py | Python | create.py | hugo-xie/meta-dataset | 3b69e23df58ccbea23888e5569f34c3b27caaa51 | [
"Apache-2.0"
] | null | null | null | create.py | hugo-xie/meta-dataset | 3b69e23df58ccbea23888e5569f34c3b27caaa51 | [
"Apache-2.0"
] | null | null | null | create.py | hugo-xie/meta-dataset | 3b69e23df58ccbea23888e5569f34c3b27caaa51 | [
"Apache-2.0"
] | null | null | null | import os
import json
ori_datadir = '/home/xieyu/dataset/ImageNet/ILSVRC2012/train'
tar_datadir = '/home/xieyu/dataset/meta-dataset/imagenet/train'
json_path = '/home/xieyu/project/meta-dataset/meta-dataset/Records/ilsvrc_2012/dataset_spec.json'
with open(json_path,'r') as load_f:
load_dict = json.load(load_f)
... | 38.478261 | 97 | 0.662147 |
c4d20e5c5166065aaf9fd15e47af1412cab9a3d6 | 12,916 | py | Python | main.py | cjzj884/iqoption-bot | a7820369d7e49bdaef3d9530c739f320450d90d1 | [
"MIT"
] | 1 | 2020-03-05T15:06:52.000Z | 2020-03-05T15:06:52.000Z | main.py | cjzj884/iqoption-bot | a7820369d7e49bdaef3d9530c739f320450d90d1 | [
"MIT"
] | null | null | null | main.py | cjzj884/iqoption-bot | a7820369d7e49bdaef3d9530c739f320450d90d1 | [
"MIT"
] | null | null | null | import requests, json
import matplotlib.pyplot as plt
import pandas as pd
import time
import os
import numpy as np
from argparse import ArgumentParser
from sklearn.linear_model import LogisticRegression
import joblib
from threading import Thread
from sklearn.ensemble import BaggingClassifier
from iqoptionapi.stable_api... | 30.248244 | 168 | 0.561784 |
f7256d283ba52ce9290a4bd6ce811edcc7a1208a | 8,082 | py | Python | juriscraper/opinions/united_states_backscrapers/federal_appellate/ca5.py | drewsilcock/juriscraper | 706a05f739e10f22b81b9bb16767415d810e49d1 | [
"BSD-2-Clause"
] | null | null | null | juriscraper/opinions/united_states_backscrapers/federal_appellate/ca5.py | drewsilcock/juriscraper | 706a05f739e10f22b81b9bb16767415d810e49d1 | [
"BSD-2-Clause"
] | null | null | null | juriscraper/opinions/united_states_backscrapers/federal_appellate/ca5.py | drewsilcock/juriscraper | 706a05f739e10f22b81b9bb16767415d810e49d1 | [
"BSD-2-Clause"
] | null | null | null | from lxml import html
from datetime import datetime, timedelta, date
from dateutil.rrule import DAILY, rrule
from selenium.common.exceptions import NoSuchElementException
from juriscraper.AbstractSite import logger
from juriscraper.OpinionSiteWebDriven import OpinionSiteWebDriven
class Site(OpinionSiteWebDriven):
... | 39.23301 | 118 | 0.548627 |
9b612b324737b5a4e4be3ef8e527cb8c2e690ab9 | 1,733 | py | Python | supporting/mask_password.py | consag/build-and-deploy-informatica | d7caaf5374f4e179cc0fc0a507d3e5da4b00c610 | [
"MIT"
] | 4 | 2019-08-20T11:50:21.000Z | 2020-07-26T18:26:00.000Z | supporting/mask_password.py | consag/build-and-deploy-informatica | d7caaf5374f4e179cc0fc0a507d3e5da4b00c610 | [
"MIT"
] | 1 | 2019-07-05T21:08:55.000Z | 2019-07-05T21:08:55.000Z | supporting/mask_password.py | consag/build-and-deploy-informatica | d7caaf5374f4e179cc0fc0a507d3e5da4b00c610 | [
"MIT"
] | 3 | 2019-11-20T00:29:02.000Z | 2020-12-09T15:05:03.000Z | # MIT License
#
# Copyright (c) 2019 Jac. Beekers
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, ... | 36.104167 | 81 | 0.70629 |
063bada43347a7d93e11ebc34812f07409a52347 | 2,309 | py | Python | tests/test_docc_api_region.py | pirate42/docc | de8e27ce5ec2e1288bff8c17a1566bbc7a26ade1 | [
"MIT"
] | 1 | 2017-08-18T08:03:55.000Z | 2017-08-18T08:03:55.000Z | tests/test_docc_api_region.py | pirate42/docc | de8e27ce5ec2e1288bff8c17a1566bbc7a26ade1 | [
"MIT"
] | null | null | null | tests/test_docc_api_region.py | pirate42/docc | de8e27ce5ec2e1288bff8c17a1566bbc7a26ade1 | [
"MIT"
] | null | null | null | # coding=utf-8
import unittest
from mock import MagicMock
from docc.region import Region
from docc.credentials import Credentials
from docc.service import Service
class TestRegion(unittest.TestCase):
def test___init__(self):
region = Region(3, "def")
self.assertEquals(3, region.id)
self.... | 28.8625 | 55 | 0.573841 |
56b58941fe70dd967d034eb8c42ccec45ed0810a | 4,886 | py | Python | Python Project/src/soumadeepPython/ClassWork_13.11.2021.py | SoumadeepChoudhury/SoumadeepChoudhury | 2419a64d7c2bde1186b3e60341e6eebeee3c6af0 | [
"MIT"
] | 1 | 2021-08-13T07:04:21.000Z | 2021-08-13T07:04:21.000Z | Python Project/src/soumadeepPython/ClassWork_13.11.2021.py | SoumadeepChoudhury/SoumadeepChoudhury | 2419a64d7c2bde1186b3e60341e6eebeee3c6af0 | [
"MIT"
] | null | null | null | Python Project/src/soumadeepPython/ClassWork_13.11.2021.py | SoumadeepChoudhury/SoumadeepChoudhury | 2419a64d7c2bde1186b3e60341e6eebeee3c6af0 | [
"MIT"
] | null | null | null | ############## HOMEWORK ################
# # WAP to enter names of the employees and their salaries as input and store them in a dictionary.
employees = {}
for _ in range(int(input("Enter number of Employees: "))):
names, salary = eval(input("Enter Name, Salary: "))
employees[names] = salary
print(employees)
... | 37.015152 | 366 | 0.63508 |
25b1b91e53be2d40852f519e11f89fcabc51330d | 3,116 | py | Python | project-deploy-model/serve/predict.py | aadimator/deep-learning-nanodegree | e553e9a1f4c16a3a9d88b34b1b874a773b5223e3 | [
"MIT"
] | null | null | null | project-deploy-model/serve/predict.py | aadimator/deep-learning-nanodegree | e553e9a1f4c16a3a9d88b34b1b874a773b5223e3 | [
"MIT"
] | 4 | 2020-03-24T16:43:53.000Z | 2021-02-02T21:53:24.000Z | project-deploy-model/serve/predict.py | aadimator/deep-learning-nanodegree | e553e9a1f4c16a3a9d88b34b1b874a773b5223e3 | [
"MIT"
] | null | null | null | import argparse
import json
import os
import pickle
import sys
import sagemaker_containers
import pandas as pd
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.utils.data
from model import LSTMClassifier
from utils import review_to_words, convert_and_pad
def model_fn(mod... | 32.8 | 107 | 0.698331 |
14683b6229623c81c7ae940d1f36e90bb3d880f9 | 535 | py | Python | LeetCode/python/tree/maximum-depth-of-binary-tree.py | Leoyuseu/Code | 34edfbbfb7875b3ed06de393c192c1f13a5074f4 | [
"BSD-Source-Code"
] | null | null | null | LeetCode/python/tree/maximum-depth-of-binary-tree.py | Leoyuseu/Code | 34edfbbfb7875b3ed06de393c192c1f13a5074f4 | [
"BSD-Source-Code"
] | null | null | null | LeetCode/python/tree/maximum-depth-of-binary-tree.py | Leoyuseu/Code | 34edfbbfb7875b3ed06de393c192c1f13a5074f4 | [
"BSD-Source-Code"
] | null | null | null | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def depth(self,root,cur_h):
if root is None:
return
cur_h += 1
if cur_h > self.max_h... | 21.4 | 36 | 0.547664 |
e43aadc5c4942af2f9eb7c49fd62ff1239d0cd8f | 13,453 | py | Python | src/CBase64/scripts/rebuild_dll_CBase64.py | isuhao/xylsxyls-xueyelingshuang | 7a2c732863aecb7ad2b1af0016b129c5041ad54b | [
"MIT"
] | 1 | 2020-06-03T03:27:26.000Z | 2020-06-03T03:27:26.000Z | src/CBase64/scripts/rebuild_dll_CBase64.py | isuhao/xylsxyls-xueyelingshuang | 7a2c732863aecb7ad2b1af0016b129c5041ad54b | [
"MIT"
] | null | null | null | src/CBase64/scripts/rebuild_dll_CBase64.py | isuhao/xylsxyls-xueyelingshuang | 7a2c732863aecb7ad2b1af0016b129c5041ad54b | [
"MIT"
] | 1 | 2020-06-03T03:27:27.000Z | 2020-06-03T03:27:27.000Z | #!python3
# -*- coding:utf-8 -*-
import os
import sys
import time
import ctypes
import shutil
import subprocess
IsPy3 = sys.version_info[0] >= 3
if IsPy3:
import winreg
else:
import codecs
import _winreg as winreg
BuildType = 'Release'
IsRebuild = True
Build = 'Rebuild'
Update = False
C... | 39.221574 | 178 | 0.582026 |
3856f0b43ce6f2e96d2c1949fd0f381d8691895a | 6,942 | py | Python | backend/purple_mountain_29856/settings.py | crowdbotics-apps/purple-mountain-29856 | 1bd636dfbc6340bef0d48a65eebdf8ba13b4d23e | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/purple_mountain_29856/settings.py | crowdbotics-apps/purple-mountain-29856 | 1bd636dfbc6340bef0d48a65eebdf8ba13b4d23e | [
"FTL",
"AML",
"RSA-MD"
] | 51 | 2021-08-16T19:50:59.000Z | 2022-03-06T18:27:13.000Z | backend/purple_mountain_29856/settings.py | crowdbotics-apps/purple-mountain-29856 | 1bd636dfbc6340bef0d48a65eebdf8ba13b4d23e | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
Django settings for purple_mountain_29856 project.
Generated by 'django-admin startproject' using Django 2.2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""... | 29.666667 | 112 | 0.731489 |
bc9ca3781dfcd1ef46d281d4aac79736641fc066 | 8,401 | py | Python | covid_qc_4.py | denisshragin/covid_qc | 645d71e9974780b702047d500b556b600f85f566 | [
"MIT"
] | null | null | null | covid_qc_4.py | denisshragin/covid_qc | 645d71e9974780b702047d500b556b600f85f566 | [
"MIT"
] | null | null | null | covid_qc_4.py | denisshragin/covid_qc | 645d71e9974780b702047d500b556b600f85f566 | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
from selenium import webdriver
import re
import requests
import io
import pandas as pd
import xlrd, xlwt
from pandas import ExcelWriter
from pandas import ExcelFile
URL = "https://www.quebec.ca/sante/problemes-de-sante/a-z/coronavirus-2019/situation-coronavirus-quebec/"
ID_1 = "#c63027" ... | 40.980488 | 398 | 0.71063 |
2ab41aab43107399a621c008e7b92feabdd508f2 | 58 | py | Python | official_phase_legacy/models/_experimental/pytorch/af_lstm.py | wenh06/cinc2020 | b3757f54df86c8470e8f22f3399b4aecd64dd5d1 | [
"BSD-2-Clause"
] | 4 | 2020-10-31T07:02:37.000Z | 2021-05-24T08:11:35.000Z | official_phase_legacy/models/_experimental/pytorch/af_lstm.py | DeepPSP/cinc2020 | 38105ed9dac6554e2dd51b94e5553fb8ba22dbe6 | [
"BSD-2-Clause"
] | null | null | null | official_phase_legacy/models/_experimental/pytorch/af_lstm.py | DeepPSP/cinc2020 | 38105ed9dac6554e2dd51b94e5553fb8ba22dbe6 | [
"BSD-2-Clause"
] | 1 | 2021-05-25T14:54:31.000Z | 2021-05-25T14:54:31.000Z | """
AF (raw) detection with rr time series using lstm
"""
| 14.5 | 49 | 0.672414 |
33c8b2cf2577464bd9244399ae8ac334f8b52af6 | 1,044 | py | Python | 13 - Multivariable Optimization in Python/code.py | m0m0khan/stackoverflow-answers | 1bee1d535db5efe406d976616407e70793deaa17 | [
"MIT"
] | null | null | null | 13 - Multivariable Optimization in Python/code.py | m0m0khan/stackoverflow-answers | 1bee1d535db5efe406d976616407e70793deaa17 | [
"MIT"
] | null | null | null | 13 - Multivariable Optimization in Python/code.py | m0m0khan/stackoverflow-answers | 1bee1d535db5efe406d976616407e70793deaa17 | [
"MIT"
] | null | null | null | # You can use scipy.optimize.minimize to minimize a scalar function with one or more variables. For this, first change your function as:
def average_receptance(x):
K_t = x[0]
C_t = x[1]
frequency_matrix = np.array([])
alphabetaE11_matrix = np.array([])
for i in range(first_natural_frequency - na... | 38.666667 | 165 | 0.743295 |
43b6bddea20a8257c007763556c278b67c202eb8 | 1,478 | py | Python | Tkinter Library/backend.py | ssergiuk/codes | ea1dea9cf3985228dacb02d31de01bc929fda939 | [
"MIT"
] | null | null | null | Tkinter Library/backend.py | ssergiuk/codes | ea1dea9cf3985228dacb02d31de01bc929fda939 | [
"MIT"
] | null | null | null | Tkinter Library/backend.py | ssergiuk/codes | ea1dea9cf3985228dacb02d31de01bc929fda939 | [
"MIT"
] | null | null | null | """
BACKEND PART
"""
import sqlite3
def connect():
conn = sqlite3.connect("books.db")
cur = conn.cursor()
cur.execute("CREATE TABLE IF NOT EXISTS book (id INTEGER PRIMARY KEY, title text, author text, year integer, isbn integer)")
conn.commit()
conn.close()
def insert(title,author,ye... | 26.872727 | 129 | 0.596076 |
2b2984cde7c21f986cedd4e92240709dd293c740 | 5,464 | py | Python | egcn_h.py | mosheber/EvolveGCN | f4957815ed60dc2f7901e26e9d3a23d507a458cf | [
"Apache-2.0"
] | 323 | 2019-10-04T01:12:39.000Z | 2022-03-18T14:30:52.000Z | egcn_h.py | mosheber/EvolveGCN | f4957815ed60dc2f7901e26e9d3a23d507a458cf | [
"Apache-2.0"
] | 15 | 2019-10-15T11:20:30.000Z | 2022-01-26T10:13:45.000Z | egcn_h.py | mosheber/EvolveGCN | f4957815ed60dc2f7901e26e9d3a23d507a458cf | [
"Apache-2.0"
] | 117 | 2019-11-02T07:55:29.000Z | 2022-03-28T16:51:16.000Z | import utils as u
import torch
from torch.nn.parameter import Parameter
import torch.nn as nn
import math
class EGCN(torch.nn.Module):
def __init__(self, args, activation, device='cpu', skipfeats=False):
super().__init__()
GRCU_args = u.Namespace({})
feats = [args.feats_per_node,
... | 32.331361 | 105 | 0.582357 |
1fcfb51a76a68efcb574cbafbd0c0b81629f66c6 | 1,164 | py | Python | searching/blind/breadth_first_search.py | QuintD/python-algorithms | ece012a8d58c3eb8bbc9719b7bfd16ada6ce7a52 | [
"Apache-2.0"
] | 1 | 2018-04-03T23:09:18.000Z | 2018-04-03T23:09:18.000Z | searching/blind/breadth_first_search.py | QuintD/python-algorithms | ece012a8d58c3eb8bbc9719b7bfd16ada6ce7a52 | [
"Apache-2.0"
] | null | null | null | searching/blind/breadth_first_search.py | QuintD/python-algorithms | ece012a8d58c3eb8bbc9719b7bfd16ada6ce7a52 | [
"Apache-2.0"
] | 1 | 2021-11-20T15:52:43.000Z | 2021-11-20T15:52:43.000Z | from searching.graph import Graph
from searching.search import Search
# b = (average) branching factor of the tree
# m = depth of the shallowest solution
# NOTE: approximations w/o loop-detection into account
# and no space of representation of paths.
# shortest path: YES
# loop detectio... | 28.390244 | 61 | 0.555842 |
bea113967598a027ffe38d4c3fd0bb37699e813a | 1,081 | py | Python | SOLID_design_principles/LSP.py | PratikRamdasi/Design-Patterns-in-Python | 689677ab861c96f4908bfc5f5fa77585e14f814c | [
"MIT"
] | null | null | null | SOLID_design_principles/LSP.py | PratikRamdasi/Design-Patterns-in-Python | 689677ab861c96f4908bfc5f5fa77585e14f814c | [
"MIT"
] | null | null | null | SOLID_design_principles/LSP.py | PratikRamdasi/Design-Patterns-in-Python | 689677ab861c96f4908bfc5f5fa77585e14f814c | [
"MIT"
] | null | null | null | class Rectangle:
def __init__(self, width, height):
self._width = width
self._height = height
@property
def area(self):
return self._height * self._width
@property
def height(self):
return self._height
@height.setter
def height(self, value):
... | 21.62 | 58 | 0.586494 |
7714acc4662ffb5e31a3fb499c21d70f16fea74b | 6,197 | py | Python | docker/localsettings.py | akshita-sh/commcare-hq | 236b25ff9cd1a634fc5586e0f9e29473c8ac71b8 | [
"BSD-3-Clause"
] | null | null | null | docker/localsettings.py | akshita-sh/commcare-hq | 236b25ff9cd1a634fc5586e0f9e29473c8ac71b8 | [
"BSD-3-Clause"
] | null | null | null | docker/localsettings.py | akshita-sh/commcare-hq | 236b25ff9cd1a634fc5586e0f9e29473c8ac71b8 | [
"BSD-3-Clause"
] | null | null | null | ####### Configuration for CommCareHQ Running in docker #######
import os
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'commcarehq',
'USER': 'commcarehq',
'PASSWORD': 'commcarehq',
'HOST': 'postgres',
'PORT': '5432',
'TEST': ... | 24.689243 | 88 | 0.57076 |
474c4d38be825b09aeccae7d4fb564dacd29c695 | 134 | py | Python | prob_mbrl/envs/pendulum/__init__.py | Praneethsv/prob_mbrl | 7b1adee6bff742b6f90e9b96ea243f12c9153b9b | [
"MIT"
] | 108 | 2018-10-24T07:59:14.000Z | 2021-11-28T05:29:35.000Z | prob_mbrl/envs/pendulum/__init__.py | Praneethsv/prob_mbrl | 7b1adee6bff742b6f90e9b96ea243f12c9153b9b | [
"MIT"
] | 8 | 2019-08-14T00:20:13.000Z | 2019-10-18T01:45:29.000Z | prob_mbrl/envs/pendulum/__init__.py | Praneethsv/prob_mbrl | 7b1adee6bff742b6f90e9b96ea243f12c9153b9b | [
"MIT"
] | 14 | 2019-06-27T10:10:08.000Z | 2020-08-31T03:16:22.000Z | from .env import Pendulum, PendulumReward
from .model import PendulumModel
__all__ = ["Pendulum", "PendulumReward", "PendulumModel"]
| 26.8 | 57 | 0.783582 |
b2daf968f5999c398d0a51283dcbd257cb7a3532 | 8,320 | py | Python | library/panos_mgtconfig.py | rtodto/ansible-pan | b38bfec1883b456a4188112605d24e0e170134f7 | [
"Apache-2.0"
] | 1 | 2019-04-19T23:08:27.000Z | 2019-04-19T23:08:27.000Z | library/panos_mgtconfig.py | rtodto/ansible-pan | b38bfec1883b456a4188112605d24e0e170134f7 | [
"Apache-2.0"
] | null | null | null | library/panos_mgtconfig.py | rtodto/ansible-pan | b38bfec1883b456a4188112605d24e0e170134f7 | [
"Apache-2.0"
] | 2 | 2019-01-31T02:51:08.000Z | 2020-09-03T15:45:52.000Z | #!/usr/bin/env python
# Copyright 2016 Palo Alto Networks, 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... | 33.015873 | 125 | 0.655168 |
447b35a6b4e6f53c4b4f80b8a3aabdc2989c1cc0 | 5,152 | py | Python | allennlp/data/token_indexers/elmo_indexer.py | codedecde/BiMPM | 818602fcf7a018632707b8fbfe33200036795731 | [
"Apache-2.0"
] | null | null | null | allennlp/data/token_indexers/elmo_indexer.py | codedecde/BiMPM | 818602fcf7a018632707b8fbfe33200036795731 | [
"Apache-2.0"
] | null | null | null | allennlp/data/token_indexers/elmo_indexer.py | codedecde/BiMPM | 818602fcf7a018632707b8fbfe33200036795731 | [
"Apache-2.0"
] | null | null | null | from typing import Dict, List
from overrides import overrides
from allennlp.common.checks import ConfigurationError
from allennlp.common.params import Params
from allennlp.common.util import pad_sequence_to_length
from allennlp.data.tokenizers.token import Token
from allennlp.data.token_indexers.token_indexer import ... | 36.28169 | 100 | 0.651592 |
c680858c5af878a71ff06fe8d6d81b1ba064c7c7 | 122 | py | Python | liquimigrate/__init__.py | marcinn/liquimigrate | 59daa1e14cd98c78286a10917dff28dee069a23e | [
"BSD-3-Clause"
] | 3 | 2015-08-05T17:13:58.000Z | 2018-06-18T10:32:48.000Z | liquimigrate/__init__.py | marcinn/liquimigrate | 59daa1e14cd98c78286a10917dff28dee069a23e | [
"BSD-3-Clause"
] | 10 | 2015-08-05T17:32:30.000Z | 2019-07-11T10:45:24.000Z | liquimigrate/__init__.py | marcinn/liquimigrate | 59daa1e14cd98c78286a10917dff28dee069a23e | [
"BSD-3-Clause"
] | 3 | 2016-11-21T14:49:15.000Z | 2019-10-14T18:15:49.000Z | #!/usr/bin/env python
# encoding: utf-8
__author__ = 'Marek Wywiał'
__email__ = 'onjinx@gmail.com'
__version__ = '0.5.2'
| 17.428571 | 30 | 0.696721 |
42450173ff3fc05205dc72bfa5a70cb41ce4c73d | 7,320 | py | Python | twccli/examples/gpu_cntr.py | gitter-badger/TWCC-CLI | fba509d77ed9636adca6039933970749e4c74968 | [
"Apache-2.0"
] | 12 | 2019-04-27T07:45:02.000Z | 2020-11-13T08:16:18.000Z | twccli/examples/gpu_cntr.py | gitter-badger/TWCC-CLI | fba509d77ed9636adca6039933970749e4c74968 | [
"Apache-2.0"
] | 23 | 2021-03-05T07:53:37.000Z | 2022-03-20T03:12:33.000Z | twccli/examples/gpu_cntr.py | gitter-badger/TWCC-CLI | fba509d77ed9636adca6039933970749e4c74968 | [
"Apache-2.0"
] | 6 | 2019-02-27T00:19:11.000Z | 2020-11-13T08:16:19.000Z | from __future__ import print_function
import click
import time
from prompt_toolkit.shortcuts import get_input
from twccli.twcc.services.compute import sites
from twccli.twcc.session import session_start
from twccli.twcc.services.projects import projects
from twccli.twcc.services.base import acls, users, image_commit
fr... | 30 | 98 | 0.628552 |
61706e70424d16414382604b57d2d03bfccb42b9 | 47 | py | Python | scripts/portal/goldTemple_sGate.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 54 | 2019-04-16T23:24:48.000Z | 2021-12-18T11:41:50.000Z | scripts/portal/goldTemple_sGate.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 3 | 2019-05-19T15:19:41.000Z | 2020-04-27T16:29:16.000Z | scripts/portal/goldTemple_sGate.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 49 | 2020-11-25T23:29:16.000Z | 2022-03-26T16:20:24.000Z | # 223010100
sm.warp(252020000, 0)
sm.dispose()
| 11.75 | 21 | 0.723404 |
28c50b6e4a9b1bb239e9fead24f0870fb2cede1f | 13,763 | py | Python | fhirclient/models/riskassessment_tests.py | carolinarsm/client-py | db1b6e3e28036dee11da75412003c7d90e591c6d | [
"Apache-2.0"
] | 418 | 2015-07-01T08:23:16.000Z | 2022-03-31T14:02:30.000Z | fhirclient/models/riskassessment_tests.py | carolinarsm/client-py | db1b6e3e28036dee11da75412003c7d90e591c6d | [
"Apache-2.0"
] | 312 | 2017-09-08T15:42:13.000Z | 2022-03-23T18:21:40.000Z | fhirclient/models/riskassessment_tests.py | carolinarsm/client-py | db1b6e3e28036dee11da75412003c7d90e591c6d | [
"Apache-2.0"
] | 185 | 2015-03-30T20:23:16.000Z | 2022-03-30T14:39:26.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07.
# 2019, SMART Health IT.
import os
import io
import unittest
import json
from . import riskassessment
from .fhirdate import FHIRDate
class RiskAssessmentTests(unittest.TestCase):
def instantiate_from(self, fi... | 60.89823 | 135 | 0.700138 |
398170b7d086a7c7a6abd2c76ee40f6b11d06fc7 | 2,473 | py | Python | internal/twirptest/google_protobuf_imports/service_pb2_twirp.py | DennisSSDev/twirp | c27eaf7ba72b359deaed686bc1e2a486214059ca | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | internal/twirptest/google_protobuf_imports/service_pb2_twirp.py | DennisSSDev/twirp | c27eaf7ba72b359deaed686bc1e2a486214059ca | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | internal/twirptest/google_protobuf_imports/service_pb2_twirp.py | DennisSSDev/twirp | c27eaf7ba72b359deaed686bc1e2a486214059ca | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Code generated by protoc-gen-twirp_python v7.1.0, DO NOT EDIT.
# source: service.proto
try:
import httplib
from urllib2 import Request, HTTPError, urlopen
except ImportError:
import http.client as httplib
from urllib.request import Request, urlopen
from urllib.error import HTTPError
import json
f... | 32.116883 | 86 | 0.617064 |
d4b0f7dce389e97e32d4ca1401d1023074548a35 | 6,558 | py | Python | config/salt/ogreserver/flask.app.conf.py | oii/ogreserver | 942d8ee612206fb094f04b3ff976187abebf3069 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | config/salt/ogreserver/flask.app.conf.py | oii/ogreserver | 942d8ee612206fb094f04b3ff976187abebf3069 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | config/salt/ogreserver/flask.app.conf.py | oii/ogreserver | 942d8ee612206fb094f04b3ff976187abebf3069 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | # vim: set ft=jinja:
import os
def getboolean(v):
# https://github.com/python/cpython/blob/2.7/Lib/ConfigParser.py#L367
_boolean_states = {'1': True, 'yes': True, 'true': True, 'on': True,
'0': False, 'no': False, 'false': False, 'off': False}
if v.lower() not in _boolean_states:
... | 33.28934 | 134 | 0.717292 |
e05ce5f6c0c4aeac9cb79acdd977cab3163de36d | 5,486 | py | Python | api/serializers.py | protwis/Protwis | fdcad0a2790721b02c0d12d8de754313714c575e | [
"Apache-2.0"
] | null | null | null | api/serializers.py | protwis/Protwis | fdcad0a2790721b02c0d12d8de754313714c575e | [
"Apache-2.0"
] | null | null | null | api/serializers.py | protwis/Protwis | fdcad0a2790721b02c0d12d8de754313714c575e | [
"Apache-2.0"
] | null | null | null | from rest_framework import serializers
from interaction.models import ResidueFragmentInteraction
from mutation.models import MutationRaw
from protein.models import Protein, ProteinConformation, ProteinFamily, Species, ProteinSource, ProteinSegment
from residue.models import Residue, ResidueNumberingScheme, ResidueGene... | 43.888 | 168 | 0.747721 |
8ce3bb17b73d6c72b011d17a4e26a432207d81b9 | 92 | py | Python | plugin/src/test/resources/highlighting/returnOutsideOfFunction.py | consulo/consulo-python | 586c3eaee3f9c2cc87fb088dc81fb12ffa4b3a9d | [
"Apache-2.0"
] | null | null | null | plugin/src/test/resources/highlighting/returnOutsideOfFunction.py | consulo/consulo-python | 586c3eaee3f9c2cc87fb088dc81fb12ffa4b3a9d | [
"Apache-2.0"
] | 11 | 2017-02-27T22:35:32.000Z | 2021-12-24T08:07:40.000Z | plugin/src/test/resources/highlighting/returnOutsideOfFunction.py | consulo/consulo-python | 586c3eaee3f9c2cc87fb088dc81fb12ffa4b3a9d | [
"Apache-2.0"
] | null | null | null | def foo():
class C:
<error descr="'return' outside of function">return 1</error> | 30.666667 | 68 | 0.619565 |
ecf3fe3a92f99488892f93f8a8c9fe3f4dd2fb54 | 264 | py | Python | jovsatools/customizing_tf_fit.py | jovsa/jovsatools | 52e7f6737376b62bbeba41dba8b54167661412a2 | [
"Apache-2.0"
] | 2 | 2020-06-06T22:46:58.000Z | 2020-07-09T22:00:38.000Z | jovsatools/customizing_tf_fit.py | jovsa/jsmltools | 52e7f6737376b62bbeba41dba8b54167661412a2 | [
"Apache-2.0"
] | 1 | 2020-09-16T19:13:22.000Z | 2020-09-16T19:13:22.000Z | jovsatools/customizing_tf_fit.py | jovsa/jsmltools | 52e7f6737376b62bbeba41dba8b54167661412a2 | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: notebooks/customizing_tf_fit.ipynb (unless otherwise specified).
__all__ = []
# Cell
from nbdev.showdoc import *
import jovsatools
import fastcore
import tensorflow as tf
from tensorflow import keras
import numpy as np | 24 | 108 | 0.799242 |
3057a96f9d37a228191328367db4e6f97870a433 | 1,006 | py | Python | startup_scripts/330_power_panels.py | OahzEgroeg/netbox-docker | 7677c7975dfa9b14aa80898f31c6281269f9c2b6 | [
"Apache-2.0"
] | null | null | null | startup_scripts/330_power_panels.py | OahzEgroeg/netbox-docker | 7677c7975dfa9b14aa80898f31c6281269f9c2b6 | [
"Apache-2.0"
] | null | null | null | startup_scripts/330_power_panels.py | OahzEgroeg/netbox-docker | 7677c7975dfa9b14aa80898f31c6281269f9c2b6 | [
"Apache-2.0"
] | 1 | 2021-02-12T14:19:28.000Z | 2021-02-12T14:19:28.000Z | import sys
from dcim.models import Site, RackGroup, PowerPanel
from startup_script_utils import *
from tenancy.models import Tenant
power_panels = load_yaml('/opt/netbox/initializers/power_panels.yml')
if power_panels is None:
sys.exit()
required_assocs = {
'site': (Site, 'name')
}
optional_assocs = {
'rack_... | 23.952381 | 70 | 0.718688 |
39ab668abedb2b8d42735fc4d62e265220b043b6 | 6,438 | py | Python | custom_components/elastic/es_index_manager.py | jordansissel/homeassistant-elasticsearch | ad56b5dc9828de7c413ccd93da966e5e51570121 | [
"MIT"
] | 1 | 2020-11-25T21:50:28.000Z | 2020-11-25T21:50:28.000Z | custom_components/elastic/es_index_manager.py | jordansissel/homeassistant-elasticsearch | ad56b5dc9828de7c413ccd93da966e5e51570121 | [
"MIT"
] | null | null | null | custom_components/elastic/es_index_manager.py | jordansissel/homeassistant-elasticsearch | ad56b5dc9828de7c413ccd93da966e5e51570121 | [
"MIT"
] | null | null | null | """ Index management facilities """
import os
import json
from urllib.parse import quote
from homeassistant.const import (CONF_ALIAS)
from .const import (
VERSION_SUFFIX, CONF_INDEX_FORMAT, CONF_ILM_POLICY_NAME,
CONF_ILM_ENABLED, CONF_ILM_DELETE_AFTER, CONF_ILM_MAX_SIZE,
INDEX_TEMPLATE_NAME
)
from .logger... | 34.063492 | 95 | 0.532774 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.