hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b318049b8c3e8cb858583b837cdffd66900a4ba8 | 25,325 | py | Python | ironic/tests/unit/drivers/modules/test_inspector.py | calsoft-internal/ironic | 6222d57a74368264b132885b6140b204f429911f | [
"Apache-2.0"
] | 1 | 2021-03-29T03:48:47.000Z | 2021-03-29T03:48:47.000Z | ironic/tests/unit/drivers/modules/test_inspector.py | calsoft-internal/ironic | 6222d57a74368264b132885b6140b204f429911f | [
"Apache-2.0"
] | null | null | null | ironic/tests/unit/drivers/modules/test_inspector.py | calsoft-internal/ironic | 6222d57a74368264b132885b6140b204f429911f | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 50.148515 | 78 | 0.667246 |
ebeff66fc68fe6177f6837993636690156c694f3 | 4,745 | py | Python | katana-cli/cli/commands/cmd_vim.py | afoteas/katana-slice_manager | f03a8520fc06f7bed18ff5c2a01a9b8ea7da84c8 | [
"Apache-2.0"
] | null | null | null | katana-cli/cli/commands/cmd_vim.py | afoteas/katana-slice_manager | f03a8520fc06f7bed18ff5c2a01a9b8ea7da84c8 | [
"Apache-2.0"
] | null | null | null | katana-cli/cli/commands/cmd_vim.py | afoteas/katana-slice_manager | f03a8520fc06f7bed18ff5c2a01a9b8ea7da84c8 | [
"Apache-2.0"
] | null | null | null | import requests
import json
import yaml
import click
import datetime
@click.group()
def cli():
"""Manage VIMs"""
pass
@click.command()
def ls():
"""
List vims
"""
url = "http://localhost:8000/api/vim"
r = None
try:
r = requests.get(url, timeout=30)
r.raise_for_statu... | 28.584337 | 89 | 0.609905 |
be48e73eec0feeac89edde093415b8c1067ec34a | 13,768 | py | Python | core/controllers/domain_objects_validator_test.py | CodeGrammer02/oppia | 3a861163aa15838b931ecc9ae39eab44e7e9073c | [
"Apache-2.0"
] | null | null | null | core/controllers/domain_objects_validator_test.py | CodeGrammer02/oppia | 3a861163aa15838b931ecc9ae39eab44e7e9073c | [
"Apache-2.0"
] | null | null | null | core/controllers/domain_objects_validator_test.py | CodeGrammer02/oppia | 3a861163aa15838b931ecc9ae39eab44e7e9073c | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The Oppia 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 applicable ... | 37.720548 | 90 | 0.593841 |
8513483b19db7a21aaf7f0f56f0f3f59d6d7f458 | 1,920 | py | Python | api/src/tests/integration/http/test_authorization.py | sedlar/work-tracking | 78917ff8200829eb674142ce43b503d8e892d7eb | [
"BSD-2-Clause"
] | null | null | null | api/src/tests/integration/http/test_authorization.py | sedlar/work-tracking | 78917ff8200829eb674142ce43b503d8e892d7eb | [
"BSD-2-Clause"
] | null | null | null | api/src/tests/integration/http/test_authorization.py | sedlar/work-tracking | 78917ff8200829eb674142ce43b503d8e892d7eb | [
"BSD-2-Clause"
] | null | null | null | from pytest import mark
from wt.ids import EntityId
from tests.integration.http.test_projects import BASE_PROJECTS_URL, get_project_url
from tests.integration.http.test_deliverables import (
BASE_DELIVERABLES_URL,
get_project_deliverables_url,
get_deliverable_url,
)
from tests.integration.http.test_issues i... | 33.684211 | 94 | 0.672917 |
e689de03a0ba7374cccf4fd58b459be60514a0c7 | 38,809 | py | Python | tests/test_core.py | xiaoleitw/voice2command | 7b0ef1bf980b580969ddda768cb48e414cd6f7fd | [
"0BSD"
] | null | null | null | tests/test_core.py | xiaoleitw/voice2command | 7b0ef1bf980b580969ddda768cb48e414cd6f7fd | [
"0BSD"
] | null | null | null | tests/test_core.py | xiaoleitw/voice2command | 7b0ef1bf980b580969ddda768cb48e414cd6f7fd | [
"0BSD"
] | null | null | null | #!/usr/bin/env python
# CREATED:2013-03-08 15:25:18 by Brian McFee <brm2132@columbia.edu>
# unit tests for librosa core (__init__.py)
#
# Run me as follows:
# cd tests/
# nosetests -v --with-coverage --cover-package=librosa
#
from __future__ import print_function
# Disable cache
import os
try:
os.environ.pop(... | 30.131211 | 113 | 0.545982 |
9b2e7d972f47f91ae37076d39b552e79a3dbb1a4 | 2,378 | py | Python | modules/test/test_tell.py | apertium/phenny | 77f302bac05e50cd7d19bc5cc2737bb98fec0cc7 | [
"EFL-2.0"
] | 7 | 2018-10-29T18:01:47.000Z | 2022-01-21T04:13:46.000Z | modules/test/test_tell.py | apertium/phenny | 77f302bac05e50cd7d19bc5cc2737bb98fec0cc7 | [
"EFL-2.0"
] | 225 | 2018-03-08T10:41:50.000Z | 2021-11-01T19:51:17.000Z | modules/test/test_tell.py | apertium/phenny | 77f302bac05e50cd7d19bc5cc2737bb98fec0cc7 | [
"EFL-2.0"
] | 44 | 2018-03-19T15:30:15.000Z | 2020-07-29T08:47:45.000Z | """
Tests for phenny's tell.py
"""
import unittest
import datetime
from mock import MagicMock
from modules import tell
class TestTell(unittest.TestCase):
def setUp(self):
self.phenny = MagicMock()
self.phenny.nick = 'phenny'
self.phenny.config.host = 'irc.oftc.net'
self.input = M... | 36.030303 | 102 | 0.629941 |
f69e65938675ebb86e2776b0dbe8b459cef44feb | 4,702 | py | Python | sliding_window.py | Fatema/python-bow-hog-object-detection | dc8d9eaaca7f3cf97dddf4562a7733bd12c222ff | [
"MIT"
] | null | null | null | sliding_window.py | Fatema/python-bow-hog-object-detection | dc8d9eaaca7f3cf97dddf4562a7733bd12c222ff | [
"MIT"
] | null | null | null | sliding_window.py | Fatema/python-bow-hog-object-detection | dc8d9eaaca7f3cf97dddf4562a7733bd12c222ff | [
"MIT"
] | null | null | null | ################################################################################
# functionality: functions for multi-scale sliding window (exhaustive) search
# This version: (c) 2018 Toby Breckon, Dept. Computer Science, Durham University, UK
# License: MIT License
# Origin acknowledgements: forked from https://git... | 35.89313 | 92 | 0.548703 |
824f02ce8931951524ec5daeed8ed0ad0c81382d | 705 | py | Python | ika_web/tests/test_login.py | Harisonm/ika | 243ceab532007ee4fb05b205e1125fab5d3d325b | [
"Apache-2.0"
] | 6 | 2020-11-17T19:41:26.000Z | 2021-01-13T14:55:56.000Z | ika_web/tests/test_login.py | Harisonm/ika | 243ceab532007ee4fb05b205e1125fab5d3d325b | [
"Apache-2.0"
] | 3 | 2020-11-16T19:51:17.000Z | 2020-11-16T19:51:36.000Z | ika_web/tests/test_login.py | Harisonm/Ika | 243ceab532007ee4fb05b205e1125fab5d3d325b | [
"Apache-2.0"
] | null | null | null | import json
from ika_web.tests.BaseCase import BaseCase
class TestUserLogin(BaseCase):
def test_successful_login(self):
# Given
email = "paurakh011@gmail.com"
password = "mycoolpassword"
payload = json.dumps({
"email": email,
"password": password
})... | 32.045455 | 120 | 0.625532 |
052e8fca6157998380290a7bb5972df137a70e10 | 2,327 | py | Python | poptorch/toolbox/Util_IOfunc.py | zhenying-liu/neuron_inverter_benchmark | 4bd940bb4498ffb29321f15fa94b87aa179a644e | [
"MIT"
] | null | null | null | poptorch/toolbox/Util_IOfunc.py | zhenying-liu/neuron_inverter_benchmark | 4bd940bb4498ffb29321f15fa94b87aa179a644e | [
"MIT"
] | null | null | null | poptorch/toolbox/Util_IOfunc.py | zhenying-liu/neuron_inverter_benchmark | 4bd940bb4498ffb29321f15fa94b87aa179a644e | [
"MIT"
] | 1 | 2022-01-14T22:25:20.000Z | 2022-01-14T22:25:20.000Z | __author__ = "Jan Balewski"
__email__ = "janstar1122@gmail.com"
import numpy as np
import time, os
import ruamel.yaml as yaml
import warnings
warnings.simplefilter('ignore', yaml.error.MantissaNoDotYAML1_1Warning)
import torch # for checkpoints
from pprint import pprint
import csv
#...!...!..................
def rea... | 32.319444 | 81 | 0.592179 |
5962e0c96855173baf9ead74168b62eef51ee37e | 216 | py | Python | Day_43/json_dump_python.py | kiranrraj/100Days_Of_Coding | ab75d83be9be87fb7bc83a3f3b72a4638dab22a1 | [
"MIT"
] | null | null | null | Day_43/json_dump_python.py | kiranrraj/100Days_Of_Coding | ab75d83be9be87fb7bc83a3f3b72a4638dab22a1 | [
"MIT"
] | null | null | null | Day_43/json_dump_python.py | kiranrraj/100Days_Of_Coding | ab75d83be9be87fb7bc83a3f3b72a4638dab22a1 | [
"MIT"
] | null | null | null | # Title : Json Module Module
# Author : Kiran Raj R.
# Date : 26/11/2020
python_json = {"name":"kiran", "email":"kiran@gmail.com", "isHappy": "Yes"}
import json
string_j = json.dumps(python_json)
print(string_j) | 24 | 75 | 0.680556 |
256de3fbaa1f6c5c53ab8d17277f9d06daad115f | 1,703 | py | Python | src/DataPlatForm/AlphaRead.py | mjcjiang/clickhouse_storage | f9483b3accd3b34d95e81478333a88082dbac275 | [
"MIT"
] | null | null | null | src/DataPlatForm/AlphaRead.py | mjcjiang/clickhouse_storage | f9483b3accd3b34d95e81478333a88082dbac275 | [
"MIT"
] | null | null | null | src/DataPlatForm/AlphaRead.py | mjcjiang/clickhouse_storage | f9483b3accd3b34d95e81478333a88082dbac275 | [
"MIT"
] | null | null | null | #-------------------------------------------------------------------------------
# Author: hjiang
# Email: heng.jiang@jingle.ai
# Time: Thu Nov 18 13:38:41 2021
#-------------------------------------------------------------------------------
from DataPlatForm.configs import *
import DataPlatForm.ReadUtils as rutils
#-... | 51.606061 | 126 | 0.425719 |
b1a3d790fe6bfab57cb0d5f27885d78dd0b78191 | 1,321 | py | Python | cohesity_management_sdk/models/tier_type_google_cloud_credentials_enum.py | chandrashekar-cohesity/management-sdk-python | 9e6ec99e8a288005804b808c4e9b19fd204e3a8b | [
"Apache-2.0"
] | 1 | 2019-11-07T23:19:32.000Z | 2019-11-07T23:19:32.000Z | cohesity_management_sdk/models/tier_type_google_cloud_credentials_enum.py | chandrashekar-cohesity/management-sdk-python | 9e6ec99e8a288005804b808c4e9b19fd204e3a8b | [
"Apache-2.0"
] | null | null | null | cohesity_management_sdk/models/tier_type_google_cloud_credentials_enum.py | chandrashekar-cohesity/management-sdk-python | 9e6ec99e8a288005804b808c4e9b19fd204e3a8b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2019 Cohesity Inc.
class TierTypeGoogleCloudCredentialsEnum(object):
"""Implementation of the 'TierType_GoogleCloudCredentials' enum.
Specifies the storage class of GCP.
GoogleTierType specifies the storage class for Google.
'kGoogleStandard' indicates a tier type ... | 33.025 | 77 | 0.738834 |
4dc55a71954d821e38d36eb736f01b3aa11b47d1 | 157 | py | Python | test_roboschool.py | marctuscher/RLAgents | 07f454acda0cd08045cb24c8dd667587973b0e09 | [
"MIT"
] | 1 | 2019-03-06T14:55:47.000Z | 2019-03-06T14:55:47.000Z | test_roboschool.py | marctuscher/RLAgents | 07f454acda0cd08045cb24c8dd667587973b0e09 | [
"MIT"
] | null | null | null | test_roboschool.py | marctuscher/RLAgents | 07f454acda0cd08045cb24c8dd667587973b0e09 | [
"MIT"
] | null | null | null | import roboschool
import gym
env = gym.make('RoboschoolAnt-v1')
env.reset()
while True:
env.step(env.action_space.sample())
env.render(close=False)
| 17.444444 | 39 | 0.726115 |
374999017e966e6fd846ccad4f4c1254c67d12ee | 778 | py | Python | py/py_0282_the_ackermann_function.py | lcsm29/project-euler | fab794ece5aa7a11fc7c2177f26250f40a5b1447 | [
"MIT"
] | null | null | null | py/py_0282_the_ackermann_function.py | lcsm29/project-euler | fab794ece5aa7a11fc7c2177f26250f40a5b1447 | [
"MIT"
] | null | null | null | py/py_0282_the_ackermann_function.py | lcsm29/project-euler | fab794ece5aa7a11fc7c2177f26250f40a5b1447 | [
"MIT"
] | null | null | null | # Solution of;
# Project Euler Problem 282: The Ackermann function
# https://projecteuler.net/problem=282
#
# $\def\htmltext#1{\style{font-family:inherit;}{\text{#1}}}$For non-negative
# integers $m$, $n$, the Ackermann function $A(m,n)$ is defined as
# follows:$$A(m,n) = \cases{n+1 &$\htmltext{ if }m=0$\crA(m-1,1) ... | 29.923077 | 79 | 0.614396 |
3dac06a39a4d7a617e57078dd22e3df0f5839140 | 6,884 | py | Python | hiicart/gateway/amazon/ipn.py | kbourgoin/hiicart | 151d64be60ffa5e09b4abc21bf42fd235bf87eea | [
"MIT"
] | null | null | null | hiicart/gateway/amazon/ipn.py | kbourgoin/hiicart | 151d64be60ffa5e09b4abc21bf42fd235bf87eea | [
"MIT"
] | 5 | 2020-10-29T01:05:05.000Z | 2020-10-29T01:05:19.000Z | hiicart/gateway/amazon/ipn.py | kbourgoin/hiicart | 151d64be60ffa5e09b4abc21bf42fd235bf87eea | [
"MIT"
] | null | null | null | import xml.etree.cElementTree as ET
from decimal import Decimal
from hiicart.gateway.amazon import fps
from hiicart.gateway.amazon.settings import SETTINGS as default_settings
from hiicart.gateway.base import IPNBase
_FPS_NS = "{http://fps.amazonaws.com/doc/2008-09-17/}"
class AmazonIPN(IPNBase):
"""Payment Gate... | 44.701299 | 112 | 0.570889 |
0de9a0ad6ab5543768ce307b21e8c89748e127ef | 1,589 | py | Python | util.py | ssedai026/tadpole-challenge | 4423716569e9928dadc8e335a7802172db56a76c | [
"Apache-2.0"
] | 2 | 2021-04-01T06:12:04.000Z | 2022-01-10T05:03:42.000Z | util.py | ssedai026/tadpole-challenge | 4423716569e9928dadc8e335a7802172db56a76c | [
"Apache-2.0"
] | null | null | null | util.py | ssedai026/tadpole-challenge | 4423716569e9928dadc8e335a7802172db56a76c | [
"Apache-2.0"
] | null | null | null | import csv
import numpy as np
import pandas as pd
from sklearn.metrics import roc_auc_score
from sklearn.preprocessing import LabelBinarizer
def read_csv_file(file_path):
with open(file_path) as f:
reader = csv.reader(f)
rows = []
first_header = next(reader)
len_head = len(first... | 21.472973 | 77 | 0.597231 |
410fd3d0d5ed414fe270c876aa0e9b7b656c4fef | 4,214 | py | Python | folium/plugins/marker_cluster.py | enricorotundo/folium | c3d21e6a90fbb21dff0a8b0851a835515b156eb8 | [
"MIT"
] | 1 | 2021-07-15T05:49:31.000Z | 2021-07-15T05:49:31.000Z | folium/plugins/marker_cluster.py | enricorotundo/folium | c3d21e6a90fbb21dff0a8b0851a835515b156eb8 | [
"MIT"
] | null | null | null | folium/plugins/marker_cluster.py | enricorotundo/folium | c3d21e6a90fbb21dff0a8b0851a835515b156eb8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
import json
from branca.element import CssLink, Figure, JavascriptLink
from folium.map import Icon, Layer, Marker, Popup
from jinja2 import Template
class MarkerCluster(Layer):
"""
Provides Beautiful Animated Marker... | 40.912621 | 130 | 0.614143 |
139ebb0990c1467342c7228e91e70c6f191b4b5e | 1,204 | py | Python | demo/main.py | Club-Alpin-Annecy/Flask-Images | 5c0d4028d3e6e04769ab7bb68258c02cd4769406 | [
"BSD-3-Clause"
] | 75 | 2015-01-07T20:25:53.000Z | 2021-11-01T17:49:00.000Z | demo/main.py | Club-Alpin-Annecy/Flask-Images | 5c0d4028d3e6e04769ab7bb68258c02cd4769406 | [
"BSD-3-Clause"
] | 30 | 2015-01-07T19:57:58.000Z | 2021-08-31T09:14:33.000Z | demo/main.py | Club-Alpin-Annecy/Flask-Images | 5c0d4028d3e6e04769ab7bb68258c02cd4769406 | [
"BSD-3-Clause"
] | 46 | 2015-01-14T03:09:03.000Z | 2022-02-01T20:18:50.000Z | from flask import Flask, request, redirect, render_template
from flask.ext.images import Images
app = Flask(__name__)
app.secret_key = 'monkey'
app.debug = True
images = Images(app)
@app.route('/')
@app.route('/demo')
def index():
url = request.args.get('url')
width = max(0, min(1000, int(request.args.get(... | 27.363636 | 68 | 0.630399 |
4affd128729a2b390f080939967e3d180e37dc54 | 12,308 | py | Python | statuscake/model/api_response.py | StatusCakeDev/statuscake-py | 267f485e6c18a6ed6e17667ceaddfce6271ec4af | [
"MIT"
] | null | null | null | statuscake/model/api_response.py | StatusCakeDev/statuscake-py | 267f485e6c18a6ed6e17667ceaddfce6271ec4af | [
"MIT"
] | null | null | null | statuscake/model/api_response.py | StatusCakeDev/statuscake-py | 267f485e6c18a6ed6e17667ceaddfce6271ec4af | [
"MIT"
] | null | null | null | """
StatusCake API
Copyright (c) 2022
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, me... | 42.885017 | 121 | 0.587504 |
532a3bc6819c496a9dc4701982e669f882ee32ca | 27,328 | py | Python | tests/Strength/TaylorImpact/TaylorImpact.py | LLNL/spheral | 282a3e6987975cd22c62c11f948da3d5db23faeb | [
"BSD-Source-Code",
"BSD-3-Clause-LBNL",
"FSFAP"
] | 19 | 2020-10-21T01:49:17.000Z | 2022-03-15T12:29:17.000Z | tests/Strength/TaylorImpact/TaylorImpact.py | LLNL/spheral | 282a3e6987975cd22c62c11f948da3d5db23faeb | [
"BSD-Source-Code",
"BSD-3-Clause-LBNL",
"FSFAP"
] | 41 | 2020-09-28T23:14:27.000Z | 2022-03-28T17:01:33.000Z | tests/Strength/TaylorImpact/TaylorImpact.py | LLNL/spheral | 282a3e6987975cd22c62c11f948da3d5db23faeb | [
"BSD-Source-Code",
"BSD-3-Clause-LBNL",
"FSFAP"
] | 5 | 2020-11-03T16:14:26.000Z | 2022-01-03T19:07:24.000Z | #-------------------------------------------------------------------------------
# The Taylor anvil impact problem -- impact of a solid cylinder on an unyielding
# surface.
#
# This scenario is based on the v=205 m/sec example in
# Eakins & Thadhani, Journal of Applied Physics, 100, 073503 (2006)
#---------------------... | 47.036145 | 260 | 0.483716 |
8bccf57fdd346fcb92e679b248d9a1590656382e | 28,918 | py | Python | salt/modules/tls.py | JesseRhoads/salt | bd5395ea85956e064970710aae03398cbd1b20f5 | [
"Apache-2.0"
] | 1 | 2020-10-02T02:29:25.000Z | 2020-10-02T02:29:25.000Z | salt/modules/tls.py | JesseRhoads/salt | bd5395ea85956e064970710aae03398cbd1b20f5 | [
"Apache-2.0"
] | null | null | null | salt/modules/tls.py | JesseRhoads/salt | bd5395ea85956e064970710aae03398cbd1b20f5 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
A salt module for SSL/TLS.
Can create a Certificate Authority (CA)
or use Self-Signed certificates.
:depends: - PyOpenSSL Python module
:configuration: Add the following values in ``/etc/salt/minion`` for the CA module
to function properly:
.. code-block:: text
ca.cert_b... | 29.15121 | 106 | 0.557819 |
f259118752ad582d83d437b8e2fd8f98760df320 | 1,604 | py | Python | py/tests/test_task.py | guidj/attx | 6a17ed393ab1f1723e7a9d8890da6313bb96c75f | [
"Apache-2.0"
] | null | null | null | py/tests/test_task.py | guidj/attx | 6a17ed393ab1f1723e7a9d8890da6313bb96c75f | [
"Apache-2.0"
] | 5 | 2020-11-13T19:02:33.000Z | 2022-02-10T02:23:14.000Z | py/tests/test_task.py | guidj/attx | 6a17ed393ab1f1723e7a9d8890da6313bb96c75f | [
"Apache-2.0"
] | null | null | null | from typing import List
import random
import hypothesis
import hypothesis.strategies as st
import pytest
import tensorflow as tf
from attx import task
@hypothesis.given(st.integers(3, 100))
def test_data_generator_yields_valid_examples(max_length: int):
gen = task.create_data_generator(max_length, "_")()
f... | 30.846154 | 78 | 0.721945 |
8b308ddfccd69bd603f3ce84136aaa51753d196a | 4,583 | py | Python | qa327/backend.py | jacob-seiler/seetgeek | 07affac0b06b8670911e348fc9d078bdf5242dc0 | [
"MIT"
] | null | null | null | qa327/backend.py | jacob-seiler/seetgeek | 07affac0b06b8670911e348fc9d078bdf5242dc0 | [
"MIT"
] | null | null | null | qa327/backend.py | jacob-seiler/seetgeek | 07affac0b06b8670911e348fc9d078bdf5242dc0 | [
"MIT"
] | 1 | 2021-01-02T19:44:53.000Z | 2021-01-02T19:44:53.000Z | from qa327.models import db, Ticket, User
from werkzeug.security import generate_password_hash, check_password_hash
from datetime import date, datetime
"""
This file defines all backend logic that interacts with database and other services
"""
def get_user(email):
"""
Get a user by a given email
:param em... | 28.290123 | 95 | 0.643901 |
d44fb82a4986c2148fc4a0c60c6d932699578e51 | 1,211 | py | Python | Scripts/ResampleTWI10mto2m/Slave_ResampleTWI.py | williamlidberg/SLU-Markfuktighetskarta | 2a0a53c71b130307047706abd37e80820dbf9f3b | [
"MIT"
] | null | null | null | Scripts/ResampleTWI10mto2m/Slave_ResampleTWI.py | williamlidberg/SLU-Markfuktighetskarta | 2a0a53c71b130307047706abd37e80820dbf9f3b | [
"MIT"
] | null | null | null | Scripts/ResampleTWI10mto2m/Slave_ResampleTWI.py | williamlidberg/SLU-Markfuktighetskarta | 2a0a53c71b130307047706abd37e80820dbf9f3b | [
"MIT"
] | null | null | null | #Script by William Lidberg
import arcpy
import sys
import os
import ctypes
MessageBox = ctypes.windll.user32.MessageBoxW
from arcpy import env
from arcpy.sa import *
arcpy.CheckOutExtension('Spatial')
#arcpy.env.scratchWorkspace = 'R:/GIS/Arcmap/Scratch.gdb'
inraster = sys.argv[1]
#Environment
#Set work... | 28.833333 | 115 | 0.733278 |
568bffbe2c6bcb4a165474cb86f769727246da9b | 20,785 | py | Python | rubicon/objc/eventloop.py | cculianu/rubicon-objc | c05ba9f654fe3afceaa94e35d082aa7630fa0da0 | [
"BSD-3-Clause"
] | 1 | 2021-06-13T23:44:46.000Z | 2021-06-13T23:44:46.000Z | rubicon/objc/eventloop.py | baby636/rubicon-objc | c05ba9f654fe3afceaa94e35d082aa7630fa0da0 | [
"BSD-3-Clause"
] | null | null | null | rubicon/objc/eventloop.py | baby636/rubicon-objc | c05ba9f654fe3afceaa94e35d082aa7630fa0da0 | [
"BSD-3-Clause"
] | 1 | 2021-06-13T23:44:36.000Z | 2021-06-13T23:44:36.000Z | """PEP 3156 event loop based on CoreFoundation"""
import threading
from asyncio import (
DefaultEventLoopPolicy, SafeChildWatcher, coroutines, events, tasks,
unix_events,
)
from ctypes import CFUNCTYPE, POINTER, Structure, c_int, c_void_p
from .core_foundation import (
CFAbsoluteTime, CFAllocatorRef, CFDa... | 33.044515 | 114 | 0.633871 |
b0f9b0055511f2c5406dc784c5de9c45c4390047 | 8,949 | py | Python | tests/certification/optional/test_advanced_fraud_tools.py | isunnapud/vantiv-sdk-for-python | 85ea6ba160c2436a305b9326cbb7d6c8f127c57c | [
"MIT"
] | 4 | 2017-11-16T16:02:06.000Z | 2021-05-04T14:40:08.000Z | tests/certification/optional/test_advanced_fraud_tools.py | isunnapud/vantiv-sdk-for-python | 85ea6ba160c2436a305b9326cbb7d6c8f127c57c | [
"MIT"
] | 7 | 2017-08-23T15:04:38.000Z | 2020-04-07T20:20:15.000Z | tests/certification/optional/test_advanced_fraud_tools.py | isunnapud/vantiv-sdk-for-python | 85ea6ba160c2436a305b9326cbb7d6c8f127c57c | [
"MIT"
] | 13 | 2017-10-17T22:07:57.000Z | 2022-03-29T17:33:42.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2017 Vantiv eCommerce
#
# 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, ... | 43.024038 | 126 | 0.538272 |
80d4a09540135813ac02b4b7c63f7a094e61eadb | 11,600 | py | Python | QtSigman/MplWidgets.py | k-cybulski/sigman-project | 1f51e04dddb375eb58182664296b7b3f1db71756 | [
"MIT"
] | 1 | 2017-11-10T10:42:07.000Z | 2017-11-10T10:42:07.000Z | QtSigman/MplWidgets.py | k-cybulski/sigman-project | 1f51e04dddb375eb58182664296b7b3f1db71756 | [
"MIT"
] | 21 | 2017-12-28T13:39:55.000Z | 2018-07-16T14:34:29.000Z | QtSigman/MplWidgets.py | k-cybulski/sigman-project | 1f51e04dddb375eb58182664296b7b3f1db71756 | [
"MIT"
] | 1 | 2018-02-25T13:57:50.000Z | 2018-02-25T13:57:50.000Z | """
Module responsible for data visualization itself.
"""
from enum import Enum
import numpy as np
from PyQt5 import QtWidgets as QW
import matplotlib
matplotlib.use('Qt5Agg')
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt5 import NavigationToolbar2... | 39.057239 | 115 | 0.63 |
4c9b75e68d27ebe6a58844a5dcc9db1d188f6f1d | 5,413 | py | Python | pontoon/terminology/utils.py | alanvidoc/pontoon | abca3fd37bc1ee47a5ef60fd12661aa70f8cf8b3 | [
"BSD-3-Clause"
] | null | null | null | pontoon/terminology/utils.py | alanvidoc/pontoon | abca3fd37bc1ee47a5ef60fd12661aa70f8cf8b3 | [
"BSD-3-Clause"
] | 1 | 2018-03-06T22:13:19.000Z | 2018-03-06T22:13:19.000Z | pontoon/terminology/utils.py | alanvidoc/pontoon | abca3fd37bc1ee47a5ef60fd12661aa70f8cf8b3 | [
"BSD-3-Clause"
] | 1 | 2018-10-13T06:07:30.000Z | 2018-10-13T06:07:30.000Z | from __future__ import absolute_import
from xml.sax.saxutils import escape, quoteattr
def build_tbx_v2_file(term_translations, locale):
"""
Generates contents of the TBX 2008 (v2) file (TBX-Default dialect):
TBX files could contain large amount of entries and it's impossible to render all the data with
... | 40.699248 | 224 | 0.528173 |
2f7654b8685c77926164fc0bd1baf996125ebc1a | 264 | py | Python | rdmo/tasks/tests/test_models.py | Raspeanut/rdmo | 9f785010a499c372a2f8368ccf76d2ea4150adcb | [
"Apache-2.0"
] | null | null | null | rdmo/tasks/tests/test_models.py | Raspeanut/rdmo | 9f785010a499c372a2f8368ccf76d2ea4150adcb | [
"Apache-2.0"
] | null | null | null | rdmo/tasks/tests/test_models.py | Raspeanut/rdmo | 9f785010a499c372a2f8368ccf76d2ea4150adcb | [
"Apache-2.0"
] | null | null | null | from ..models import Task
def test_task_str(db):
instances = Task.objects.all()
for instance in instances:
assert str(instance)
def test_task_clean(db):
instances = Task.objects.all()
for instance in instances:
instance.clean()
| 18.857143 | 34 | 0.674242 |
3fc19762d3b76023d88402aa002bb58250327d8c | 4,674 | py | Python | tests/connection/test_main.py | avin-kavish/graphene_django_crud | 2ed7dc457da006fe872a6257b8b62256381d9eb7 | [
"MIT"
] | 19 | 2021-01-16T17:31:34.000Z | 2022-03-22T20:15:28.000Z | tests/connection/test_main.py | avin-kavish/graphene_django_crud | 2ed7dc457da006fe872a6257b8b62256381d9eb7 | [
"MIT"
] | 8 | 2021-05-24T05:42:35.000Z | 2022-03-07T12:14:53.000Z | tests/connection/test_main.py | avin-kavish/graphene_django_crud | 2ed7dc457da006fe872a6257b8b62256381d9eb7 | [
"MIT"
] | 6 | 2021-05-28T16:21:13.000Z | 2022-03-04T12:46:17.000Z | # -*- coding: utf-8 -*-
import pytest
from tests.client import Client
from tests.utils import verify_response
import json
from .models import *
def test_main():
for i in range(10):
a = TestConnA()
a.text = str(i)
a.nb = i
a.save()
for j in range(10):
b = TestCo... | 29.770701 | 79 | 0.195764 |
7ab6ddde5703baa5e312851f71759231f6965ddf | 1,895 | py | Python | VOID/utils/parser/dock.py | learningmatter-mit/VOID | 792ab22fa560250e1673f8ace9de0b98a77fa034 | [
"MIT"
] | 2 | 2021-09-19T12:00:42.000Z | 2022-02-14T22:12:24.000Z | VOID/utils/parser/dock.py | learningmatter-mit/VOID | 792ab22fa560250e1673f8ace9de0b98a77fa034 | [
"MIT"
] | 4 | 2021-02-19T17:09:13.000Z | 2022-01-10T17:26:55.000Z | VOID/utils/parser/dock.py | learningmatter-mit/VOID | 792ab22fa560250e1673f8ace9de0b98a77fa034 | [
"MIT"
] | 3 | 2022-01-10T17:01:05.000Z | 2022-03-02T23:17:15.000Z | from .base import Parser
from VOID import dockers, samplers, fitness
class DockParser(Parser):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.docker_opts = self.get_dockers_parsers()
self.sampler_opts = self.get_samplers_parsers()
self.fitness_opts = se... | 29.153846 | 101 | 0.572032 |
7d43ac43e47cfbdeec2df6c43d241a5f3a177e8a | 1,509 | py | Python | bc/model/resnet/signals.py | rjgpinel/rlbc | 55a7499e4ad10182d9a84ce3c2494231db6fd3b5 | [
"MIT"
] | 43 | 2019-10-16T02:56:13.000Z | 2022-01-25T02:04:51.000Z | bc/model/resnet/signals.py | rjgpinel/rlbc | 55a7499e4ad10182d9a84ce3c2494231db6fd3b5 | [
"MIT"
] | 6 | 2019-10-16T03:44:24.000Z | 2021-06-19T21:59:09.000Z | bc/model/resnet/signals.py | rjgpinel/rlbc | 55a7499e4ad10182d9a84ce3c2494231db6fd3b5 | [
"MIT"
] | 11 | 2020-03-23T01:47:46.000Z | 2021-11-25T07:43:25.000Z | import torch
import torch.nn as nn
from bc.model.resnet.feat import ResNetFeat
from bc.model.resnet.utils import init_weights
class ResNetSignals(ResNetFeat):
def __init__(self,
block=None,
layers=None,
block_depth=(64, 128, 256, 512),
fcs=tuple... | 29.019231 | 77 | 0.548708 |
cb5d0e5327adfe408302b75c31de81cf37c7406d | 14,028 | py | Python | hwtLib/tools/debug_bus_monitor_ctl.py | Nic30/hwtLib | 52fd28023c4a25f64da17bb4d7c3089d5c7348f4 | [
"MIT"
] | 24 | 2017-02-23T10:00:50.000Z | 2022-01-28T12:20:21.000Z | hwtLib/tools/debug_bus_monitor_ctl.py | Nic30/hwtLib | 52fd28023c4a25f64da17bb4d7c3089d5c7348f4 | [
"MIT"
] | 32 | 2017-04-28T10:29:34.000Z | 2021-04-27T09:16:43.000Z | hwtLib/tools/debug_bus_monitor_ctl.py | Nic30/hwtLib | 52fd28023c4a25f64da17bb4d7c3089d5c7348f4 | [
"MIT"
] | 8 | 2019-09-19T03:34:36.000Z | 2022-01-21T06:56:58.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from io import StringIO
import json
from math import ceil
import subprocess
import sys
from typing import List, Union, Tuple, Optional, Dict
def bit_mask(w):
"""
:note: duplication with pyMathBitPrecise in order to keep this script without non-std dependencies
... | 37.013193 | 130 | 0.596593 |
5cb7e875f4a760fb186a3e0245c5d95dc5d01993 | 1,550 | py | Python | tests/test_multiple_nodes.py | dmitrygx/ucx-py | b0132c5f269e4b681225f7f15969100f86ac7742 | [
"BSD-3-Clause"
] | null | null | null | tests/test_multiple_nodes.py | dmitrygx/ucx-py | b0132c5f269e4b681225f7f15969100f86ac7742 | [
"BSD-3-Clause"
] | null | null | null | tests/test_multiple_nodes.py | dmitrygx/ucx-py | b0132c5f269e4b681225f7f15969100f86ac7742 | [
"BSD-3-Clause"
] | null | null | null | import asyncio
import numpy as np
import pytest
import ucp
async def hello(ep):
msg2send = np.arange(10)
msg2recv = np.empty_like(msg2send)
f1 = ep.send(msg2send)
f2 = ep.recv(msg2recv)
await f1
await f2
np.testing.assert_array_equal(msg2send, msg2recv)
assert isinstance(ep.ucx_info(... | 25 | 65 | 0.7 |
aadeeb07ba7e8c1251ab329cce4c612750c5f767 | 7,439 | py | Python | FunFun.py | DanilKrivonos/FunFun | 09e262dc6935164910329906cb3df6cd99dd0dff | [
"MIT"
] | null | null | null | FunFun.py | DanilKrivonos/FunFun | 09e262dc6935164910329906cb3df6cd99dd0dff | [
"MIT"
] | null | null | null | FunFun.py | DanilKrivonos/FunFun | 09e262dc6935164910329906cb3df6cd99dd0dff | [
"MIT"
] | null | null | null | import os
from re import X
import sys
import logging
import argparse
import shutil
import numpy as np
from pandas import read_csv, DataFrame
from Bio.SeqIO import parse
from itertools import product
from subprocess import call
from scipy.spatial.distance import pdist, squareform
import plotly.express as px
#from pand... | 30.995833 | 112 | 0.573464 |
764844259642b32d5025432f02942431f42cfb32 | 6,621 | py | Python | sms.py | wpmjones/cathy | cefd2caa10e35b71d3c5e6094be3f9ff584cb73b | [
"MIT"
] | null | null | null | sms.py | wpmjones/cathy | cefd2caa10e35b71d3c5e6094be3f9ff584cb73b | [
"MIT"
] | null | null | null | sms.py | wpmjones/cathy | cefd2caa10e35b71d3c5e6094be3f9ff584cb73b | [
"MIT"
] | null | null | null | import creds
from db import Messages, get_db
from twilio.rest import Client
from twilio.base.exceptions import TwilioRestException
# Connect to Twilio
account_sid = creds.twilio_account_sid
auth_token = creds.twilio_auth_token
twilio_client = Client(account_sid, auth_token)
@app.command("/text_welcome")
async def t... | 38.271676 | 117 | 0.520163 |
ad6094f2d1136ff58809e8f19452b84e1c83973c | 1,891 | py | Python | NetworkDrawing.py | mmerkel/triangles-segga | c01b7d67bd1631e13fa80805a90d37803c37e3c1 | [
"BSD-2-Clause"
] | 3 | 2021-04-30T13:31:45.000Z | 2022-02-16T21:59:28.000Z | NetworkDrawing.py | mmerkel/triangles-segga | c01b7d67bd1631e13fa80805a90d37803c37e3c1 | [
"BSD-2-Clause"
] | null | null | null | NetworkDrawing.py | mmerkel/triangles-segga | c01b7d67bd1631e13fa80805a90d37803c37e3c1 | [
"BSD-2-Clause"
] | 1 | 2021-09-24T01:34:50.000Z | 2021-09-24T01:34:50.000Z | from random import randint
from PyQt4.QtGui import QColor
from numpy import array, cos, sin, exp
def drawCellWithRandomColor(pdf, cell, fillAlpha=0x40, width=0.3, centerRadius=2):
pointList = [e.vertex.position for e in cell.edges]
r, g, b = randint(0, 255), randint(0, 255), randint(0, 255)
pdf.drawPolyg... | 43.976744 | 175 | 0.683765 |
2e5de225c378094cb09eed97959a76a03084563a | 217 | py | Python | setup.py | laurenzane/basic_stats | 93135a1c25bd611ef85d8b6287ffdeaf061c09bb | [
"MIT"
] | null | null | null | setup.py | laurenzane/basic_stats | 93135a1c25bd611ef85d8b6287ffdeaf061c09bb | [
"MIT"
] | null | null | null | setup.py | laurenzane/basic_stats | 93135a1c25bd611ef85d8b6287ffdeaf061c09bb | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name = "basic_stats",
version = "0.0.1",
author = "Lauren Zane",
package_dir={"basic_stats"},
packages=['mean'],
install_requires=['matplotlib','numpy'],
)
| 19.727273 | 44 | 0.626728 |
f822168eb8dc31c1f3cc69d1f1e5fa06d1ae1167 | 731 | py | Python | nipype/interfaces/afni/tests/test_auto_AFNICommand.py | demianw/nipype | 52d64c30d96ecd94f1833156e28dce32c4f05ebe | [
"BSD-3-Clause"
] | null | null | null | nipype/interfaces/afni/tests/test_auto_AFNICommand.py | demianw/nipype | 52d64c30d96ecd94f1833156e28dce32c4f05ebe | [
"BSD-3-Clause"
] | 2 | 2017-10-05T21:08:38.000Z | 2018-10-09T23:01:23.000Z | nipype/interfaces/afni/tests/test_auto_AFNICommand.py | effigies/nipype | 18fe222557cf3b9627e06b2a66fba589feaca581 | [
"Apache-2.0"
] | 1 | 2016-10-11T19:18:53.000Z | 2016-10-11T19:18:53.000Z | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..base import AFNICommand
def test_AFNICommand_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
usedefault=Tr... | 25.206897 | 77 | 0.655267 |
5ab4050fbb54e04d8acbfaa2d5a840998ee1bdf8 | 980 | py | Python | ghettoq/tests/test_beanstalk.py | ask/ghettoq | 22a0fcd865b618cbbbfd102efd88a7983507c24e | [
"BSD-3-Clause"
] | 5 | 2015-01-13T14:36:52.000Z | 2021-05-07T15:45:55.000Z | ghettoq/tests/test_beanstalk.py | ask/ghettoq | 22a0fcd865b618cbbbfd102efd88a7983507c24e | [
"BSD-3-Clause"
] | null | null | null | ghettoq/tests/test_beanstalk.py | ask/ghettoq | 22a0fcd865b618cbbbfd102efd88a7983507c24e | [
"BSD-3-Clause"
] | null | null | null | import unittest
from anyjson import serialize, deserialize
from ghettoq.simple import Connection, Empty
def create_connection():
return Connection("beanstalk", host="localhost")
class TestBeanstalkBackend(unittest.TestCase):
def test_empty_raises_Empty(self):
conn = create_connection()
q ... | 28 | 68 | 0.642857 |
59bc7f10271244c06a2851571219f8330265bd4b | 955 | py | Python | master/server/migrations/0001_initial.py | renanxavierdev/pycluster | d24a0ce2d692cd695ddb2e7945b2b035f2f32f2f | [
"Unlicense"
] | 1 | 2020-10-20T20:15:13.000Z | 2020-10-20T20:15:13.000Z | master/server/migrations/0001_initial.py | renanxavierdev/pycluster | d24a0ce2d692cd695ddb2e7945b2b035f2f32f2f | [
"Unlicense"
] | null | null | null | master/server/migrations/0001_initial.py | renanxavierdev/pycluster | d24a0ce2d692cd695ddb2e7945b2b035f2f32f2f | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-11-06 16:26
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Hosts',
... | 29.84375 | 114 | 0.55288 |
1195ada907f85d5527ae7ab40764ddd89c5edfdc | 3,225 | py | Python | setup.py | zweien/pytorch-lightning | ddc49c472fa1b0a320494508d7473640553cfeeb | [
"Apache-2.0"
] | 1 | 2019-12-03T14:53:54.000Z | 2019-12-03T14:53:54.000Z | setup.py | zweien/pytorch-lightning | ddc49c472fa1b0a320494508d7473640553cfeeb | [
"Apache-2.0"
] | null | null | null | setup.py | zweien/pytorch-lightning | ddc49c472fa1b0a320494508d7473640553cfeeb | [
"Apache-2.0"
] | 1 | 2020-12-18T19:46:19.000Z | 2020-12-18T19:46:19.000Z | #!/usr/bin/env python
import os
from io import open
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
try:
import builtins
except ImportError:
import __builtin__ as builtins
# https://packaging.python.org/guides/single-sourcing-package-version/
# http://blog.ionelmc.ro/201... | 36.647727 | 86 | 0.687132 |
86e68b6c56f6a1b498ce2f3138d4263153b9125f | 3,374 | py | Python | metadeploy/api/tests/admin.py | sfdc-qbranch/MetaDeploy | d22547b3814dbec6aefa4d86b9f81c6f175c1b67 | [
"BSD-3-Clause"
] | 33 | 2019-03-20T15:34:39.000Z | 2022-03-30T15:59:40.000Z | metadeploy/api/tests/admin.py | sfdc-qbranch/MetaDeploy | d22547b3814dbec6aefa4d86b9f81c6f175c1b67 | [
"BSD-3-Clause"
] | 2,718 | 2019-02-27T19:46:07.000Z | 2022-03-11T23:18:09.000Z | metadeploy/api/tests/admin.py | sfdc-qbranch/MetaDeploy | d22547b3814dbec6aefa4d86b9f81c6f175c1b67 | [
"BSD-3-Clause"
] | 28 | 2019-03-28T04:57:16.000Z | 2022-02-04T16:49:25.000Z | import pytest
from django.contrib.admin.sites import AdminSite
from django.test import RequestFactory
from ..admin import (
AllowedListOrgAdmin,
ArrayFieldCheckboxSelectMultiple,
MetadeployTranslatableAdmin,
PlanAdmin,
PlanMixin,
)
from ..models import AllowedListOrg, Plan
class Dummy:
pass
... | 29.858407 | 85 | 0.65086 |
09e376df502a5fdaa7e30f3f15cb0cafce818a35 | 402 | py | Python | openimages/settings.py | lehy/shufflenet-v2-chainer | 1ac313328f30b12d61243daf9e6e5a5fffe82c0d | [
"MIT"
] | null | null | null | openimages/settings.py | lehy/shufflenet-v2-chainer | 1ac313328f30b12d61243daf9e6e5a5fffe82c0d | [
"MIT"
] | null | null | null | openimages/settings.py | lehy/shufflenet-v2-chainer | 1ac313328f30b12d61243daf9e6e5a5fffe82c0d | [
"MIT"
] | null | null | null | import os
persistent_directory = '/home/paperspace'
published_directory = '/home/paperspace/public_html'
fast_directory = '/home/paperspace/'
cold_data_directory = os.path.join(persistent_directory, 'data')
hot_data_directory = os.path.join(fast_directory, 'data')
openimages_directory = os.path.join(hot_data_director... | 36.545455 | 75 | 0.800995 |
b29afc0cb48e91256729a986d3fa64c1e8beff2b | 224 | py | Python | src/sentry/search/solr/__init__.py | ChadKillingsworth/sentry | ffcb9007a95a83ee267935fe605f8ee8f03a85a5 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/search/solr/__init__.py | ChadKillingsworth/sentry | ffcb9007a95a83ee267935fe605f8ee8f03a85a5 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/search/solr/__init__.py | ChadKillingsworth/sentry | ffcb9007a95a83ee267935fe605f8ee8f03a85a5 | [
"BSD-3-Clause"
] | null | null | null | """
sentry.search.solr
~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
| 22.4 | 75 | 0.696429 |
ab0ad047de2c4f20feba137fb6715a77fee9d551 | 1,676 | py | Python | ninestargram_server/images/models.py | apJammanbo/ninestargram-server | 6aaf5e49a4189da6df9af8afec921d97455d6841 | [
"MIT"
] | null | null | null | ninestargram_server/images/models.py | apJammanbo/ninestargram-server | 6aaf5e49a4189da6df9af8afec921d97455d6841 | [
"MIT"
] | 11 | 2020-09-05T20:04:21.000Z | 2022-03-03T22:38:32.000Z | ninestargram_server/images/models.py | apJammanbo/ninestargram-server | 6aaf5e49a4189da6df9af8afec921d97455d6841 | [
"MIT"
] | null | null | null | from django.db import models
from ninestargram_server.users import models as user_models
from taggit.managers import TaggableManager
class TimeStampedModel(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
class Meta:
abstract = ... | 24.289855 | 84 | 0.671241 |
838f4534d925f9967046fe97161b2b9cdf5821d0 | 378 | py | Python | bikesharing/models/location_tracker_type.py | mohnbroetchen2/cykel_jenarad | 6ed9fa45d8b98e1021bc41a57e1250ac6f0cfcc4 | [
"MIT"
] | 80 | 2019-08-20T17:41:31.000Z | 2021-05-31T19:20:28.000Z | bikesharing/models/location_tracker_type.py | mohnbroetchen2/cykel_jenarad | 6ed9fa45d8b98e1021bc41a57e1250ac6f0cfcc4 | [
"MIT"
] | 19 | 2019-08-24T15:17:33.000Z | 2021-09-22T17:58:03.000Z | bikesharing/models/location_tracker_type.py | mohnbroetchen2/cykel_jenarad | 6ed9fa45d8b98e1021bc41a57e1250ac6f0cfcc4 | [
"MIT"
] | 12 | 2019-08-21T17:55:14.000Z | 2021-04-07T18:53:52.000Z | from django.db import models
class LocationTrackerType(models.Model):
name = models.CharField(default=None, null=True, blank=True, max_length=255)
battery_voltage_warning = models.FloatField(default=None, null=True, blank=True)
battery_voltage_critical = models.FloatField(default=None, null=True, blank=Tr... | 34.363636 | 85 | 0.753968 |
9d65b19bbf4f557cc1e46b7fa591e3c649f78509 | 2,093 | py | Python | color.py | SevenQuanta/SPACEcam | e7e83946ccf50a598f6fa1f05f4426be0cc16357 | [
"MIT"
] | null | null | null | color.py | SevenQuanta/SPACEcam | e7e83946ccf50a598f6fa1f05f4426be0cc16357 | [
"MIT"
] | 4 | 2021-06-08T20:27:37.000Z | 2022-03-12T00:02:18.000Z | color.py | dschimtz/StereoVision | c05fd81c4e0656fdc31eb5e837e94c735c45730d | [
"MIT"
] | null | null | null | import binascii
import struct
from PIL import Image
from scipy import cluster
import numpy as np
import scipy
import scipy.misc
import scipy.cluster
import colorsys
NUM_CLUSTERS = 5
class ArtCritic():
def __init__(self, img):
self.img = img # = Image.open("reference_image.jpg")
self.img = img.resi... | 33.758065 | 83 | 0.618729 |
40550629068c0cc024f66ecac0ec5871fd930ec7 | 1,789 | py | Python | keystoneclient/auth/token_endpoint.py | dtroyer/python-keystoneclient | 4776495adfadbf5240a9e0f169990ce139af9549 | [
"Apache-1.1"
] | 1 | 2019-09-11T11:56:19.000Z | 2019-09-11T11:56:19.000Z | keystoneclient/auth/token_endpoint.py | dtroyer/python-keystoneclient | 4776495adfadbf5240a9e0f169990ce139af9549 | [
"Apache-1.1"
] | null | null | null | keystoneclient/auth/token_endpoint.py | dtroyer/python-keystoneclient | 4776495adfadbf5240a9e0f169990ce139af9549 | [
"Apache-1.1"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 32.527273 | 77 | 0.663499 |
6ad00c9276f6f661a9fdb7c01afe34eb2b8a7e11 | 445 | py | Python | foo/sc.py | jmnel/datapipeline | b3b023fc8aaae2dd7f97cf0fddcab9d1133f2dc5 | [
"MIT"
] | null | null | null | foo/sc.py | jmnel/datapipeline | b3b023fc8aaae2dd7f97cf0fddcab9d1133f2dc5 | [
"MIT"
] | null | null | null | foo/sc.py | jmnel/datapipeline | b3b023fc8aaae2dd7f97cf0fddcab9d1133f2dc5 | [
"MIT"
] | null | null | null | from nameko.extensions import DependencyProvider
from nameko.rpc import rpc
class Master:
name = "master"
@rpc
def method(self):
l = self.other_rpc.get_dependency()
return l.method()
class Slave(DependencyProvider):
name = "slave"
def setup(self):
pass
#container = Se... | 16.481481 | 49 | 0.680899 |
9601d5e6a1a11bde165646f6b36a6e6d366763b7 | 5,593 | py | Python | tests/scripts/thread-cert/Cert_7_1_05_BorderRouterAsRouter.py | jjlee3/openthread | abba21bca6e1b07ca76b0241dfaf045e57396818 | [
"BSD-3-Clause"
] | 3 | 2018-06-20T11:13:33.000Z | 2020-12-08T15:15:10.000Z | tests/scripts/thread-cert/Cert_7_1_05_BorderRouterAsRouter.py | jjlee3/openthread | abba21bca6e1b07ca76b0241dfaf045e57396818 | [
"BSD-3-Clause"
] | null | null | null | tests/scripts/thread-cert/Cert_7_1_05_BorderRouterAsRouter.py | jjlee3/openthread | abba21bca6e1b07ca76b0241dfaf045e57396818 | [
"BSD-3-Clause"
] | 3 | 2017-08-29T01:31:57.000Z | 2020-05-07T22:56:52.000Z | #!/usr/bin/python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# not... | 42.052632 | 102 | 0.653674 |
cc177c9d5bc9b41b0cb3b95e883a6e6804036e17 | 5,872 | py | Python | pyleecan/Classes/ImportMatlab.py | mxgnsr/pyleecan | 2b0a04e4ae67c073a91362ab42332908fef53bdd | [
"Apache-2.0"
] | 2 | 2019-06-08T15:04:39.000Z | 2020-09-07T13:32:22.000Z | pyleecan/Classes/ImportMatlab.py | mxgnsr/pyleecan | 2b0a04e4ae67c073a91362ab42332908fef53bdd | [
"Apache-2.0"
] | null | null | null | pyleecan/Classes/ImportMatlab.py | mxgnsr/pyleecan | 2b0a04e4ae67c073a91362ab42332908fef53bdd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# File generated according to Generator/ClassesRef/Import/ImportMatlab.csv
# WARNING! All changes made in this file will be lost!
"""Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Import/ImportMatlab
"""
from os import linesep
from logging import getLogg... | 32.988764 | 110 | 0.629087 |
3a7e0be49685b20ac36db9c6cfc27e9133dbfb76 | 342 | py | Python | app/db/session.py | SonGokussj4/fast-api-excercise | 15ae21fd2dba7cbf6bf42a2beee52a379e66c847 | [
"MIT"
] | null | null | null | app/db/session.py | SonGokussj4/fast-api-excercise | 15ae21fd2dba7cbf6bf42a2beee52a379e66c847 | [
"MIT"
] | null | null | null | app/db/session.py | SonGokussj4/fast-api-excercise | 15ae21fd2dba7cbf6bf42a2beee52a379e66c847 | [
"MIT"
] | null | null | null | from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, Session
from app.core.config import settings
# engine = create_engine(settings.SQLALCHEMY_DATABASE_URI, client_encoding='utf8')
engine = create_engine(settings.SQLALCHEMY_DATABASE_URI)
SessionLocal = sessionmaker(autocommit=False, autoflus... | 34.2 | 82 | 0.842105 |
f8df1130e3b5e1d34090d456250d4fd45782a23b | 5,217 | py | Python | MCN/utils.py | ShuangWangCN/MCN_model | 1614fd3ca74214b178ace380fbf47e6df183a30f | [
"MIT"
] | 3 | 2021-09-14T11:06:00.000Z | 2021-12-27T15:06:53.000Z | MCN/utils.py | ShuangWangCN/MCN_model | 1614fd3ca74214b178ace380fbf47e6df183a30f | [
"MIT"
] | null | null | null | MCN/utils.py | ShuangWangCN/MCN_model | 1614fd3ca74214b178ace380fbf47e6df183a30f | [
"MIT"
] | null | null | null | from torch_geometric.data import InMemoryDataset, Batch
from torch_geometric import data as DATA
import torch,pickle
import numpy as np
from MCN.molecule_prepare import smile_to_graph
def collate(data_list):
mol_data_list=[data[0] for data in data_list]
batchA = Batch.from_data_list(mol_data_list)
... | 38.644444 | 113 | 0.616446 |
6ea8d3a0573633d6a04aec4e793a6faa656fa0ef | 668 | py | Python | plugins/ping.py | nat-king-15/videomuscbot | f6099ec31154869981ba833f821b08381171f123 | [
"MIT"
] | 3 | 2021-12-06T15:53:15.000Z | 2022-03-16T13:01:39.000Z | plugins/ping.py | ALREADYBROKEN24/solidmusic | e921e4a7f2ffe188c16aae87b3082079ac9cb3af | [
"MIT"
] | null | null | null | plugins/ping.py | ALREADYBROKEN24/solidmusic | e921e4a7f2ffe188c16aae87b3082079ac9cb3af | [
"MIT"
] | 7 | 2021-12-06T15:53:18.000Z | 2022-03-16T13:02:43.000Z | from time import time
from pyrogram import Client, filters
from pyrogram.types import Message
from core.clients import call_py
from database.lang_utils import get_message as gm
@Client.on_message(filters.command("ping"))
async def check_ping_(_, message: Message):
chat_id = message.chat.id
start = time()
... | 23.857143 | 74 | 0.69012 |
02d49dacc1b355bac4548969f7c54ed31bf727a9 | 10,139 | py | Python | tests/integration/s2n_dynamic_record_size_test.py | ragona/s2n | 40b8c84442c88fb67d7c07e6f272eade48d9e673 | [
"Apache-2.0"
] | 1 | 2018-08-10T14:00:40.000Z | 2018-08-10T14:00:40.000Z | tests/integration/s2n_dynamic_record_size_test.py | ragona/s2n | 40b8c84442c88fb67d7c07e6f272eade48d9e673 | [
"Apache-2.0"
] | 1 | 2019-11-06T22:04:18.000Z | 2019-11-06T22:04:18.000Z | tests/integration/s2n_dynamic_record_size_test.py | ragona/s2n | 40b8c84442c88fb67d7c07e6f272eade48d9e673 | [
"Apache-2.0"
] | 2 | 2018-01-31T19:26:30.000Z | 2018-01-31T21:53:25.000Z | #
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0
#
# or in the "license" file accom... | 34.369492 | 239 | 0.643653 |
89252067423b8bd6eddb817b06d470d1f03fc5e3 | 3,117 | py | Python | pytorch/shuffle_hdf5_mem.py | mjm522/gpd | 6327f20eabfcba41a05fdd2e2ba408153dc2e958 | [
"BSD-2-Clause"
] | 439 | 2017-05-23T07:03:17.000Z | 2022-03-21T09:08:35.000Z | pytorch/shuffle_hdf5_mem.py | mjm522/gpd | 6327f20eabfcba41a05fdd2e2ba408153dc2e958 | [
"BSD-2-Clause"
] | 113 | 2017-05-23T16:52:23.000Z | 2022-03-17T02:06:19.000Z | pytorch/shuffle_hdf5_mem.py | mjm522/gpd | 6327f20eabfcba41a05fdd2e2ba408153dc2e958 | [
"BSD-2-Clause"
] | 221 | 2017-05-23T22:05:30.000Z | 2022-03-14T07:15:59.000Z | import h5py
import h5py_cache as h5c
import numpy as np
import os
import sys
CHUNK_CACHE = 1024**2*4000
if len(sys.argv) < 4:
print('Error: not enough input arguments!')
print('Usage: python3 shuffle_h5_mem_2pass.py IN_H5 OUT_H5 STEPS')
exit(-1)
fin = sys.argv[1]
fout = sys.argv[2]
steps = int(sys.argv[3... | 42.69863 | 120 | 0.562079 |
55b3975e708b0b3695b7cce1bc73066339a4a9c4 | 448 | py | Python | holidata/holidays/__init__.py | vice/holidata | 24c6d168516ea15f19de3858dde7e15ccb2276c9 | [
"MIT"
] | null | null | null | holidata/holidays/__init__.py | vice/holidata | 24c6d168516ea15f19de3858dde7e15ccb2276c9 | [
"MIT"
] | null | null | null | holidata/holidays/__init__.py | vice/holidata | 24c6d168516ea15f19de3858dde7e15ccb2276c9 | [
"MIT"
] | null | null | null | from .holidays import Locale
__all__ = [
"Locale",
"cs-CZ",
"da-DK",
"de-AT",
"de-BE",
"de-CH",
"de-DE",
"el-GR",
"en-CA",
"en-GB",
"en-NZ",
"en-US",
"es-CO",
"es-ES",
"es-US",
"fi-FI",
"fr-BE",
"fr-CA",
"fr-FR",
"hr-HR",
"is-IS",
... | 12.444444 | 28 | 0.350446 |
e53d784da3012ae78b7ddca5a527c0ff9491eb1d | 10,420 | py | Python | main.py | jorcontrerasp/BuscadorE2eGitHubRepos | a7a4e43368c45550093921ae1d37254e2696fba0 | [
"Apache-2.0"
] | null | null | null | main.py | jorcontrerasp/BuscadorE2eGitHubRepos | a7a4e43368c45550093921ae1d37254e2696fba0 | [
"Apache-2.0"
] | null | null | null | main.py | jorcontrerasp/BuscadorE2eGitHubRepos | a7a4e43368c45550093921ae1d37254e2696fba0 | [
"Apache-2.0"
] | 1 | 2021-05-23T15:24:34.000Z | 2021-05-23T15:24:34.000Z | #TFG (estudio CI/CD GitHub) - Programa de validación
#Importamos las librerías necesarias.
from github import Github
import configuracion as conf
import filtrosQuery as fq
import criterios
import auxiliares
import pandas as pd
import datetime
import random
import os
import busquedaBD
def exe():
fRepos = 'repos.pi... | 42.016129 | 124 | 0.593954 |
490a965f6907656c9cba360f734b89b0d7d9af9a | 5,851 | py | Python | itests/fe/permission_request_test.py | ph0enix49/merou | cbbe2386d0e12ee79a58827ff9e589fbbc9694b3 | [
"Apache-2.0"
] | null | null | null | itests/fe/permission_request_test.py | ph0enix49/merou | cbbe2386d0e12ee79a58827ff9e589fbbc9694b3 | [
"Apache-2.0"
] | null | null | null | itests/fe/permission_request_test.py | ph0enix49/merou | cbbe2386d0e12ee79a58827ff9e589fbbc9694b3 | [
"Apache-2.0"
] | null | null | null | from typing import TYPE_CHECKING
from mock import ANY
from grouper.constants import PERMISSION_GRANT
from grouper.entities.permission_grant import GroupPermissionGrant
from itests.pages.groups import GroupViewPage
from itests.pages.permission import PermissionPage
from itests.pages.permission_request import Permissio... | 41.792857 | 99 | 0.702273 |
ca0b57a63a42744f83747fe138e2debdf3929893 | 1,383 | py | Python | bot.py | pytghhvvgh45/GPlink-bot | 966114ba4f32bbddcb1f5a7ddadc25c41bb8be53 | [
"MIT"
] | null | null | null | bot.py | pytghhvvgh45/GPlink-bot | 966114ba4f32bbddcb1f5a7ddadc25c41bb8be53 | [
"MIT"
] | null | null | null | bot.py | pytghhvvgh45/GPlink-bot | 966114ba4f32bbddcb1f5a7ddadc25c41bb8be53 | [
"MIT"
] | null | null | null | from os import environ
import aiohttp
from pyrogram import Client, filters
API_ID = environ.get('API_ID')
API_HASH = environ.get('API_HASH')
BOT_TOKEN = environ.get('BOT_TOKEN')
API_KEY = environ.get('API_KEY', '5fd20df0c4db85798dd4f5ff3d03e3606a94f98b')
bot = Client('gplink bot',
api_id=API_ID,
... | 30.065217 | 86 | 0.65799 |
a2ebaa1bc4a59b9cd6972e775209f61d37a98224 | 4,969 | py | Python | python/tink/aead/_aead_key_templates_test.py | yfung/tink | e6792c3b57986623c536af1161ec6dad4f6159e4 | [
"Apache-2.0"
] | null | null | null | python/tink/aead/_aead_key_templates_test.py | yfung/tink | e6792c3b57986623c536af1161ec6dad4f6159e4 | [
"Apache-2.0"
] | 1 | 2022-03-02T13:25:38.000Z | 2022-03-02T13:25:38.000Z | python/tink/aead/_aead_key_templates_test.py | yfung/tink | e6792c3b57986623c536af1161ec6dad4f6159e4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 45.587156 | 80 | 0.765345 |
f4d0f264da3757b43d160682bc34313b4c0102d6 | 238,272 | py | Python | tests/server_test_cases/person_note_tests.py | ZhengC1/personfinder | 7e40f2783ac89b91efd1d8497f1acc5b006361fa | [
"Apache-2.0"
] | 1 | 2020-11-20T22:05:25.000Z | 2020-11-20T22:05:25.000Z | tests/server_test_cases/person_note_tests.py | ZhengC1/personfinder | 7e40f2783ac89b91efd1d8497f1acc5b006361fa | [
"Apache-2.0"
] | null | null | null | tests/server_test_cases/person_note_tests.py | ZhengC1/personfinder | 7e40f2783ac89b91efd1d8497f1acc5b006361fa | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python2.7
# encoding: utf-8
# Copyright 2010 Google 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 ... | 45.454407 | 98 | 0.624555 |
47beb7cb1b9bfd2bfa9ecdaca163483ded85a2ef | 3,372 | py | Python | protein_inference/inference/false_discovery_rate_calculator.py | MassDynamics/protein-inference | 05cc9738a3fcd074d8e6789bb24979a9837082cf | [
"MIT"
] | 4 | 2020-11-25T03:08:07.000Z | 2020-11-25T23:28:06.000Z | protein_inference/inference/false_discovery_rate_calculator.py | MassDynamics/protein-inference | 05cc9738a3fcd074d8e6789bb24979a9837082cf | [
"MIT"
] | null | null | null | protein_inference/inference/false_discovery_rate_calculator.py | MassDynamics/protein-inference | 05cc9738a3fcd074d8e6789bb24979a9837082cf | [
"MIT"
] | 1 | 2020-11-25T04:52:04.000Z | 2020-11-25T04:52:04.000Z | from pandas import concat
import matplotlib.pyplot as plt
#import plotly_express as px
class FalseDiscoveryRateCalculator():
"""
Packages related function for estimating false discovery
rates and q - values.
"""
def FDR(self, threshold, target, decoy):
'''
... | 34.408163 | 85 | 0.58452 |
8a7e6787f7aa155fbc66e47dc5b19c4f510fc7c0 | 2,938 | py | Python | modules/tools/rosbag/extract_trajectory.py | zhouzhibo0117/apollo | f7a2369315a2bf106e473ced7392f4542f4ff3a3 | [
"Apache-2.0"
] | 4 | 2019-12-27T05:37:20.000Z | 2020-03-24T07:21:54.000Z | modules/tools/rosbag/extract_trajectory.py | zhouzhibo0117/apollo | f7a2369315a2bf106e473ced7392f4542f4ff3a3 | [
"Apache-2.0"
] | 2 | 2020-06-11T12:48:33.000Z | 2020-08-28T01:07:43.000Z | modules/tools/rosbag/extract_trajectory.py | zhouzhibo0117/apollo | f7a2369315a2bf106e473ced7392f4542f4ff3a3 | [
"Apache-2.0"
] | 57 | 2019-11-22T05:56:22.000Z | 2019-12-28T08:51:10.000Z | #!/usr/bin/env python3
###############################################################################
# Copyright 2018 The Apollo 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... | 32.285714 | 88 | 0.637168 |
7301a5f79d632d4500f1869bda5d7cdba79ebf15 | 261 | py | Python | order_management/order_management/doctype/city/test_city.py | aswinnishta/order_management | 93c2daa921f9854c24ca90925e9fa28f66d35baa | [
"MIT"
] | null | null | null | order_management/order_management/doctype/city/test_city.py | aswinnishta/order_management | 93c2daa921f9854c24ca90925e9fa28f66d35baa | [
"MIT"
] | null | null | null | order_management/order_management/doctype/city/test_city.py | aswinnishta/order_management | 93c2daa921f9854c24ca90925e9fa28f66d35baa | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Nishta Solutions and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('City')
class TestCity(unittest.TestCase):
pass
| 20.076923 | 55 | 0.766284 |
cbd0aaa2fc96fcb85a3ef66f896e3f462237ff92 | 11,245 | py | Python | PROJECT PACKS/hhw881_2331_25_ATAHAN_OZTURK_ITGS_IA/Product/Python Files/MasterAndUI.py | atahanozturk/IB-ITGS-IA | 35827384e4e28897602eae057857a05963bb2f13 | [
"Apache-2.0"
] | 1 | 2019-09-24T02:18:17.000Z | 2019-09-24T02:18:17.000Z | PROJECT PACKS/hhw881_2331_25_ATAHAN_OZTURK_ITGS_IA/Product/Python Files/MasterAndUI.py | atahanozturk/IB-ITGS-IA | 35827384e4e28897602eae057857a05963bb2f13 | [
"Apache-2.0"
] | null | null | null | PROJECT PACKS/hhw881_2331_25_ATAHAN_OZTURK_ITGS_IA/Product/Python Files/MasterAndUI.py | atahanozturk/IB-ITGS-IA | 35827384e4e28897602eae057857a05963bb2f13 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#coding:utf8
from tkinter.filedialog import *
from tkinter import ttk;
import ExcelHandler
import DataHandler
def InitializeRoot():
global tabStuScrollable, tabActScrollable, stuSearchVar, actSearchVar, stuCountVar, actCountVar, statsVar, mainframe, nb
root = Tk ()
root.geometry ... | 41.802974 | 186 | 0.627657 |
7c98779518699037f8be40609da184c1656f5405 | 8,579 | py | Python | dit/math/sigmaalgebra.py | chebee7i/dit | 59626e34c7938fddeec140522dd2a592ba4f42ef | [
"BSD-2-Clause"
] | null | null | null | dit/math/sigmaalgebra.py | chebee7i/dit | 59626e34c7938fddeec140522dd2a592ba4f42ef | [
"BSD-2-Clause"
] | null | null | null | dit/math/sigmaalgebra.py | chebee7i/dit | 59626e34c7938fddeec140522dd2a592ba4f42ef | [
"BSD-2-Clause"
] | null | null | null | """
Functions for generating sigma algebras on finite sets.
Chetan Jhurani
http://users.ices.utexas.edu/~chetan/Publications.html
http://users.ices.utexas.edu/~chetan/reports/2009-03-ices-set_algebra_algorithms.pdf
"""
from collections import defaultdict
import numpy as np
from dit.utils import pow... | 29.685121 | 88 | 0.592144 |
b5617a0591478f7c6e5cadd90dfc7453adcfacf4 | 14,153 | py | Python | packages/pytea/pytest/benchmarks/transformers/tests/test_modeling_flaubert.py | lego0901/pytea | 8ede650def2e68f4610ba816451d8b9e28f09f76 | [
"MIT"
] | 1 | 2020-11-14T06:08:38.000Z | 2020-11-14T06:08:38.000Z | packages/pytea/pytest/benchmarks/transformers/tests/test_modeling_flaubert.py | lego0901/pytea | 8ede650def2e68f4610ba816451d8b9e28f09f76 | [
"MIT"
] | null | null | null | packages/pytea/pytest/benchmarks/transformers/tests/test_modeling_flaubert.py | lego0901/pytea | 8ede650def2e68f4610ba816451d8b9e28f09f76 | [
"MIT"
] | 1 | 2020-11-16T23:12:50.000Z | 2020-11-16T23:12:50.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language 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 ... | 35.119107 | 117 | 0.669823 |
b46b56b11ff89cdcbcef70af56adc0a4d7c2ad35 | 3,950 | py | Python | lib/project.py | renebentes/JoomlaProjects | 30c07041b90fc51e4de3fb544b378854f71db2f1 | [
"MIT"
] | 1 | 2015-04-19T10:36:18.000Z | 2015-04-19T10:36:18.000Z | lib/project.py | renebentes/JoomlaProjects | 30c07041b90fc51e4de3fb544b378854f71db2f1 | [
"MIT"
] | null | null | null | lib/project.py | renebentes/JoomlaProjects | 30c07041b90fc51e4de3fb544b378854f71db2f1 | [
"MIT"
] | 1 | 2015-01-14T02:10:55.000Z | 2015-01-14T02:10:55.000Z | # coding: utf-8
import sublime
import os
st_version = int(sublime.version())
if st_version > 3000:
from JoomlaPack.lib import *
else:
from lib import *
class Project:
def root(self):
'''
Get the project root define by user or standard.
'''
root = Helper().settings('proje... | 28.417266 | 77 | 0.537215 |
401ed9151a9da0ab865a5408c2c03bc88d4a7eed | 1,805 | py | Python | image_3D_stack.py | sinodanishspain/BioMulti-L-NL-Model | ce3ef6834f82d14c3a9b44f6ce79175c79fed432 | [
"BSD-3-Clause"
] | 2 | 2021-05-20T15:40:59.000Z | 2021-08-10T21:58:50.000Z | image_3D_stack.py | sinodanishspain/BioMulti-L-NL-Model | ce3ef6834f82d14c3a9b44f6ce79175c79fed432 | [
"BSD-3-Clause"
] | 1 | 2021-02-25T22:06:52.000Z | 2021-02-25T22:06:52.000Z | image_3D_stack.py | sinodanishspain/BioMulti-L-NL-Model | ce3ef6834f82d14c3a9b44f6ce79175c79fed432 | [
"BSD-3-Clause"
] | null | null | null | '''
========================================================================
Image 3D Stack Visualization
Copyright(c) 2020 QiangLi
All Right Reserved
qiang.li@uv.es
Distributed under the (new) BSD License
=======================================================================-
Permission to use, copy, or modify this s... | 36.1 | 83 | 0.71856 |
e5e8b7823ba20cd80ea82eb5bb6ac2e88b56c6a7 | 2,532 | py | Python | script_demo_master.py | nat-chan/pixel2style2pixel | 4bd2d99fd47cf21589d21722ddb3c7eb538ad196 | [
"MIT"
] | null | null | null | script_demo_master.py | nat-chan/pixel2style2pixel | 4bd2d99fd47cf21589d21722ddb3c7eb538ad196 | [
"MIT"
] | null | null | null | script_demo_master.py | nat-chan/pixel2style2pixel | 4bd2d99fd47cf21589d21722ddb3c7eb538ad196 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from subprocess import PIPE, Popen, STDOUT, check_output
from threading import Timer
from pathlib import Path
import os
import re
import coloredlogs, logging
coloredlogs.install()
os.environ["PYTHONUNBUFFERED"] = "1"
cmd_app = ["/home/natsuki/miniconda3/envs/ada/bin/python3", "script_gradio_app.... | 28.133333 | 90 | 0.578199 |
b0099d631cacc24bae2f71e3817b0113e65edccb | 17,944 | py | Python | PyFlow/Core/InputWidgets.py | ZeroCool940711/PyFlow-1 | cc11f788b72d9a47196d5039b24e81121891823c | [
"MIT"
] | null | null | null | PyFlow/Core/InputWidgets.py | ZeroCool940711/PyFlow-1 | cc11f788b72d9a47196d5039b24e81121891823c | [
"MIT"
] | null | null | null | PyFlow/Core/InputWidgets.py | ZeroCool940711/PyFlow-1 | cc11f788b72d9a47196d5039b24e81121891823c | [
"MIT"
] | null | null | null | import weakref
from Qt import QtCore
from Qt import QtGui
from Qt.QtWidgets import QDoubleSpinBox
from Qt.QtWidgets import QSpinBox
from Qt.QtWidgets import QWidget
from Qt.QtWidgets import QSpacerItem
from Qt.QtWidgets import QPushButton
from Qt.QtWidgets import QComboBox
from Qt.QtWidgets import QLineEdit
from Qt.QtW... | 30.362098 | 157 | 0.760979 |
5d004b2e7c097ad67170a554ba3c1147276da395 | 23,692 | py | Python | testplan/runners/pools/base.py | ymn1k/testplan | b1bde8495c449d75a74a7fe4e7c6501b0476f833 | [
"Apache-2.0"
] | null | null | null | testplan/runners/pools/base.py | ymn1k/testplan | b1bde8495c449d75a74a7fe4e7c6501b0476f833 | [
"Apache-2.0"
] | null | null | null | testplan/runners/pools/base.py | ymn1k/testplan | b1bde8495c449d75a74a7fe4e7c6501b0476f833 | [
"Apache-2.0"
] | 1 | 2019-09-11T09:13:18.000Z | 2019-09-11T09:13:18.000Z | """Worker pool executor base classes."""
import os
import time
import inspect
import threading
from schema import Or, And
from testplan.common.config import ConfigOption, validate_func
from testplan.common.entity import (Resource, ResourceConfig,
Environment, Runnable)
from testpl... | 36.393241 | 80 | 0.574287 |
5fe4a2ce17ae4ed184d69bb2286a1df23747fa15 | 28,938 | py | Python | myems-api/excelexporters/combinedequipmentload.py | RichardZhong/myems-carbon | fec34f938a7c8e0166544704eb8467a41d6b034f | [
"MIT"
] | null | null | null | myems-api/excelexporters/combinedequipmentload.py | RichardZhong/myems-carbon | fec34f938a7c8e0166544704eb8467a41d6b034f | [
"MIT"
] | null | null | null | myems-api/excelexporters/combinedequipmentload.py | RichardZhong/myems-carbon | fec34f938a7c8e0166544704eb8467a41d6b034f | [
"MIT"
] | 1 | 2022-01-29T14:22:17.000Z | 2022-01-29T14:22:17.000Z | import base64
import uuid
import os
from openpyxl.chart import LineChart, Reference
from openpyxl.chart.label import DataLabelList
from openpyxl.styles import PatternFill, Border, Side, Alignment, Font
from openpyxl.drawing.image import Image
from openpyxl import Workbook
import openpyxl.utils.cell as format_cell
###... | 44.865116 | 120 | 0.547412 |
47ebb34efb4547c94d9df39028d771b0eb486364 | 5,684 | py | Python | scripts/rocsparse_bench_gnuplot_helper.py | Voldmare/rocSPARSE | 13159879e6a301d4fb799524e3299a96096902bb | [
"MIT"
] | null | null | null | scripts/rocsparse_bench_gnuplot_helper.py | Voldmare/rocSPARSE | 13159879e6a301d4fb799524e3299a96096902bb | [
"MIT"
] | null | null | null | scripts/rocsparse_bench_gnuplot_helper.py | Voldmare/rocSPARSE | 13159879e6a301d4fb799524e3299a96096902bb | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# ########################################################################
# Copyright (c) 2021-2022 Advanced Micro Devices, Inc.
#
# 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 ... | 42.736842 | 182 | 0.639338 |
ccc6a3939cd40ad9649d455182defb2ec948aac5 | 1,481 | py | Python | src/Request.py | Mxngls/Gomsaek | 15f18a3817fc181342e8adaeb5445f163268460a | [
"MIT"
] | null | null | null | src/Request.py | Mxngls/Gomsaek | 15f18a3817fc181342e8adaeb5445f163268460a | [
"MIT"
] | null | null | null | src/Request.py | Mxngls/Gomsaek | 15f18a3817fc181342e8adaeb5445f163268460a | [
"MIT"
] | null | null | null | import requests as r
import xml.etree.ElementTree as ET
class Requests:
def search_request(self, word):
search_params = {
'key': '',
'q': word,
'sort': 'popular',
'translated': 'y',
'trans_lang': '1'
}
search_response = r.get('https://krdict.korean.... | 34.44186 | 108 | 0.621877 |
dda422a4362a8295e23c17dd22709e18708f1f94 | 46,990 | py | Python | src/transformers/models/opt/modeling_tf_opt.py | bugface/transformers | ba286fe7d51db12ad663effac83bed8199dd7141 | [
"Apache-2.0"
] | 5 | 2020-09-01T09:15:48.000Z | 2020-09-15T03:25:05.000Z | src/transformers/models/opt/modeling_tf_opt.py | bugface/transformers | ba286fe7d51db12ad663effac83bed8199dd7141 | [
"Apache-2.0"
] | null | null | null | src/transformers/models/opt/modeling_tf_opt.py | bugface/transformers | ba286fe7d51db12ad663effac83bed8199dd7141 | [
"Apache-2.0"
] | 3 | 2020-08-20T04:46:25.000Z | 2020-10-14T08:39:13.000Z | # coding=utf-8
# Copyright 2022 The Fairseq Authors and The HuggingFace Inc. team. 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/... | 44.795043 | 221 | 0.656054 |
4be717a9a14a897d614da36574784f6485e29840 | 17,693 | py | Python | gym/f110_gym/envs/base_classes.py | jinkim31/F110 | 889b3f9cdd960ea30d8cd70fe2af11971d13d699 | [
"BSD-2-Clause"
] | 33 | 2020-06-30T08:42:46.000Z | 2022-03-25T15:20:31.000Z | gym/f110_gym/envs/base_classes.py | jinkim31/F110 | 889b3f9cdd960ea30d8cd70fe2af11971d13d699 | [
"BSD-2-Clause"
] | 29 | 2020-06-03T08:32:30.000Z | 2022-01-31T18:49:51.000Z | gym/f110_gym/envs/base_classes.py | jinkim31/F110 | 889b3f9cdd960ea30d8cd70fe2af11971d13d699 | [
"BSD-2-Clause"
] | 32 | 2020-04-24T17:58:00.000Z | 2022-03-12T10:08:00.000Z | # MIT License
# Copyright (c) 2020 Joseph Auckley, Matthew O'Kelly, Aman Sinha, Hongrui Zheng
# 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 limitati... | 34.966403 | 217 | 0.58899 |
a4a88e81824231dfc9d3a4b4c4dd4d9688b7531b | 27,361 | py | Python | tests/end_to_end/helpers/env.py | ashalitkin/pipelinewise | 52901c801ccd591c01cf7a2e5e3309db121d027d | [
"Apache-2.0"
] | null | null | null | tests/end_to_end/helpers/env.py | ashalitkin/pipelinewise | 52901c801ccd591c01cf7a2e5e3309db121d027d | [
"Apache-2.0"
] | null | null | null | tests/end_to_end/helpers/env.py | ashalitkin/pipelinewise | 52901c801ccd591c01cf7a2e5e3309db121d027d | [
"Apache-2.0"
] | null | null | null | import os
import re
import glob
import boto3
import shutil
import subprocess
from dotenv import load_dotenv
from . import db
USER_HOME = os.path.expanduser('~')
CONFIG_DIR = os.path.join(USER_HOME, '.pipelinewise')
DIR = os.path.dirname(os.path.realpath(__file__))
class E2EEnv:
"""Utilities class to run End to ... | 57.481092 | 117 | 0.555353 |
cae4dbc1067aa1ef7432c1470bbf28a812ce692e | 3,816 | py | Python | META/GS/SA.py | satiros12/MUIA | 165f0bb2d5b0a4e40dfb25263a0f6756ea04ebc3 | [
"Apache-2.0"
] | null | null | null | META/GS/SA.py | satiros12/MUIA | 165f0bb2d5b0a4e40dfb25263a0f6756ea04ebc3 | [
"Apache-2.0"
] | null | null | null | META/GS/SA.py | satiros12/MUIA | 165f0bb2d5b0a4e40dfb25263a0f6756ea04ebc3 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import time
def gradualTimmeUpdate(T_initial, T_final, K_steps, T_current):
Betta = (T_initial - T_final*1.0) / (K_steps*1.0* T_initial * T_final)
return T_current*1.0/(1.0 + Betta*T_current)
#Simulated Annealing Continuous
def SAC(MAX_ITERATIONS, InitialPoi... | 56.117647 | 298 | 0.680556 |
51fc6c7f9a887bcb29a0c7efa2f657321b522f6a | 5,087 | py | Python | tests/geography/test_load_zones.py | anamileva/gridpath | e55eacb88ca5e6c034a90b18819e17cbd6f43854 | [
"Apache-2.0"
] | null | null | null | tests/geography/test_load_zones.py | anamileva/gridpath | e55eacb88ca5e6c034a90b18819e17cbd6f43854 | [
"Apache-2.0"
] | null | null | null | tests/geography/test_load_zones.py | anamileva/gridpath | e55eacb88ca5e6c034a90b18819e17cbd6f43854 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016-2020 Blue Marble Analytics LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 36.335714 | 79 | 0.576568 |
d45eaa04605ebba7ac88dfc7542e1eb86236219a | 6,632 | py | Python | redditor-downloader/downloader.py | garonfok/redditor-downloader | a755487b7835cf26d4667226dd63d74029973ce6 | [
"MIT"
] | null | null | null | redditor-downloader/downloader.py | garonfok/redditor-downloader | a755487b7835cf26d4667226dd63d74029973ce6 | [
"MIT"
] | null | null | null | redditor-downloader/downloader.py | garonfok/redditor-downloader | a755487b7835cf26d4667226dd63d74029973ce6 | [
"MIT"
] | null | null | null | import praw
import os
import requests
import sys
import yt_dlp
from datetime import datetime as dt
from dotenv import load_dotenv
from hashlib import md5
load_dotenv()
class RedditorDownloader:
def __init__(self, username, download_dir):
self.username = username
self.download_dir = f"{download_di... | 39.47619 | 92 | 0.482207 |
a26538942da4ddd05f3fc41af02c04f676b4db96 | 3,143 | py | Python | mccd/denoising/evaluate.py | tobias-liaudat/deep_mccd | 55254a89df4b38e6130f79298b0ee1491753d0fb | [
"MIT"
] | null | null | null | mccd/denoising/evaluate.py | tobias-liaudat/deep_mccd | 55254a89df4b38e6130f79298b0ee1491753d0fb | [
"MIT"
] | 5 | 2022-02-19T17:08:52.000Z | 2022-03-02T16:20:09.000Z | mccd/denoising/evaluate.py | tobias-liaudat/deep_mccd | 55254a89df4b38e6130f79298b0ee1491753d0fb | [
"MIT"
] | null | null | null |
r"""EVALUATE.
Module description ..
"""
import numpy as np
import tensorflow as tf
from mccd.denoising.image_utils import trim_padding
# from learnlets.image_utils import trim_padding
try:
from runstats import Statistics
from skimage.metrics import peak_signal_noise_ratio, structural_similarity
except Module... | 28.0625 | 94 | 0.64238 |
48c88fd87cdaa79f46d439dee5dce3ddafa421f3 | 4,424 | py | Python | tests/test_subsample.py | broadinstitute/scp-ingest-service | 1a63a27061b53a5f7909c72d59808f9af71456a6 | [
"BSD-3-Clause"
] | 1 | 2020-06-08T16:30:47.000Z | 2020-06-08T16:30:47.000Z | tests/test_subsample.py | broadinstitute/scp-ingest-service | 1a63a27061b53a5f7909c72d59808f9af71456a6 | [
"BSD-3-Clause"
] | 146 | 2019-07-25T13:09:47.000Z | 2022-03-28T19:29:22.000Z | tests/test_subsample.py | broadinstitute/scp-ingest-service | 1a63a27061b53a5f7909c72d59808f9af71456a6 | [
"BSD-3-Clause"
] | null | null | null | """Tests subsampling
These tests verify:
- Binning correctly
- Subsampling correctly
PREREQUISITES
Spin up Python 3.6 virtualenv, install Python dependencies in requirements.txt
Note: When CI environment moves to Python 3.7, tests may break due to minor
differences in how the reference issues are serialized
... | 38.469565 | 168 | 0.583635 |
5b44e2667c3c833b4a39bb031f3d65488944c959 | 4,489 | py | Python | scripts/klf14_b6ntac_exp_0077_generate_non_overlap_training_images.py | rcasero/cytometer | d76e58fa37f83f6a666d556ba061530d787fcfb2 | [
"Apache-2.0"
] | 1 | 2021-06-09T10:18:26.000Z | 2021-06-09T10:18:26.000Z | scripts/klf14_b6ntac_exp_0077_generate_non_overlap_training_images.py | rcasero/cytometer | d76e58fa37f83f6a666d556ba061530d787fcfb2 | [
"Apache-2.0"
] | null | null | null | scripts/klf14_b6ntac_exp_0077_generate_non_overlap_training_images.py | rcasero/cytometer | d76e58fa37f83f6a666d556ba061530d787fcfb2 | [
"Apache-2.0"
] | null | null | null | """
Rasterise hand traced contours as polygons, and split overlapping areas between contributing cells using watershed.
This script creates the data in klf14_b6ntac_training_non_overlap.
"""
"""
This file is part of Cytometer
Copyright 2021 Medical Research Council
SPDX-License-Identifier: Apache-2.0
Author: Ramon Cas... | 30.537415 | 115 | 0.668969 |
05efc369ed2d71f01d9ac6ade03c12932416286b | 1,312 | py | Python | run_jph_cv.py | lux-jwang/goodoos | 3b8f7778ea639d168218e2d0db5933bafab85fc9 | [
"MIT"
] | 1 | 2015-09-03T13:45:26.000Z | 2015-09-03T13:45:26.000Z | run_jph_cv.py | lux-jwang/goodoos | 3b8f7778ea639d168218e2d0db5933bafab85fc9 | [
"MIT"
] | null | null | null | run_jph_cv.py | lux-jwang/goodoos | 3b8f7778ea639d168218e2d0db5933bafab85fc9 | [
"MIT"
] | null | null | null | import numpy as np
import sys
import datetime
import matplotlib.pyplot as plt
sys.path.append("./src")
from models import Model, FriendsModel
from similarities import CosineSimilarity, JaccardSimilarity
from dataset import get_friends_data, get_user_item_matrix, get_user_item_matrix_sub, \
get_reput... | 34.526316 | 87 | 0.720274 |
a25613fbcc9e8cf1f3f855ca1e12bbf612205af8 | 5,624 | py | Python | azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/effective_network_security_rule.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/effective_network_security_rule.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-network/azure/mgmt/network/v2018_07_01/models/effective_network_security_rule.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 55.137255 | 108 | 0.689189 |
4c8d1e6cfd3919b5355230038b90ba129690e04e | 662 | py | Python | backend/manage.py | somarae8/bomberbot_finalproject | 732df88487087e067ba3048cda6d92a0fe63586a | [
"MIT"
] | 2 | 2020-11-03T17:37:20.000Z | 2020-11-03T19:34:25.000Z | backend/manage.py | somarae8/bomberbot_finalproject | 732df88487087e067ba3048cda6d92a0fe63586a | [
"MIT"
] | null | null | null | backend/manage.py | somarae8/bomberbot_finalproject | 732df88487087e067ba3048cda6d92a0fe63586a | [
"MIT"
] | 1 | 2020-11-03T16:48:58.000Z | 2020-11-03T16:48:58.000Z | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'bjango.settings')
try:
from django.core.management import execute_from_command_line
except Impor... | 28.782609 | 73 | 0.678248 |
c2dbe82f7950a8c07d42877c7b54085e7315d002 | 5,037 | py | Python | deepr/utils/tables.py | drohde/deepr | 672772ea3ce9cf391f9f8efc7ae9c9d438957817 | [
"Apache-2.0"
] | null | null | null | deepr/utils/tables.py | drohde/deepr | 672772ea3ce9cf391f9f8efc7ae9c9d438957817 | [
"Apache-2.0"
] | null | null | null | deepr/utils/tables.py | drohde/deepr | 672772ea3ce9cf391f9f8efc7ae9c9d438957817 | [
"Apache-2.0"
] | null | null | null | """Tables Utilities"""
import logging
from typing import Dict
import numpy as np
import tensorflow as tf
from deepr.utils.field import TensorType
LOGGER = logging.getLogger(__name__)
class TableContext:
"""Context Manager to reuse Tensorflow tables.
Tensorflow does not have a ``tf.get_variable`` equival... | 32.921569 | 111 | 0.630137 |
fb1f23251ee80f25e0178f7162de7f5885d31ca4 | 2,962 | py | Python | .github/workflows/python/validate_cla_signature.py | jha-g/brackets | ca0f8ddd24df238962c92b8629f19859ea168dcf | [
"MIT"
] | null | null | null | .github/workflows/python/validate_cla_signature.py | jha-g/brackets | ca0f8ddd24df238962c92b8629f19859ea168dcf | [
"MIT"
] | null | null | null | .github/workflows/python/validate_cla_signature.py | jha-g/brackets | ca0f8ddd24df238962c92b8629f19859ea168dcf | [
"MIT"
] | null | null | null | import os
import sys
import json
import subprocess
import re
import requests
def extract_personal_contributer_details():
personal_cla_link = "https://raw.githubusercontent.com/brackets-cont/contributor-license-agreement/main/personal_contributor_licence_agreement.md"
f = requests.get(personal_cla_link)
pe... | 35.261905 | 150 | 0.739365 |
10f56c0b3203e59bc7a874073706bfe7e7cab6c8 | 7,455 | py | Python | constrained_optimization_linear_constraints/projected_quasi_newton_algorithm.py | almostdutch/numerical-optimization-algorithms | cd6c1306cb04eccce62a74420323bda83058c1d6 | [
"MIT"
] | null | null | null | constrained_optimization_linear_constraints/projected_quasi_newton_algorithm.py | almostdutch/numerical-optimization-algorithms | cd6c1306cb04eccce62a74420323bda83058c1d6 | [
"MIT"
] | 1 | 2021-06-02T10:07:26.000Z | 2021-06-03T10:23:46.000Z | constrained_optimization_linear_constraints/projected_quasi_newton_algorithm.py | almostdutch/numerical-optimization-algorithms | cd6c1306cb04eccce62a74420323bda83058c1d6 | [
"MIT"
] | null | null | null | """
projected_quasi_newton_algorithm.py
Returns the minimizer of the function
X0 - initial guess
func - anonimous function
func_grad - anonimous function gradient
N_iter_max - max number of iterations
P - projector onto nullspace of A, A @ X = B;
"""
import numpy as np
def srs(h_old, delta_X, delta_grad):
d... | 37.462312 | 155 | 0.60228 |
a03da085585a96f384b44c20936615e17a1a07a6 | 401,092 | py | Python | whitebox_tools.py | luzpaz/whitebox-tools | 55508fe0805e4cccec1c3fde46e4a1efacda5ad4 | [
"MIT"
] | null | null | null | whitebox_tools.py | luzpaz/whitebox-tools | 55508fe0805e4cccec1c3fde46e4a1efacda5ad4 | [
"MIT"
] | null | null | null | whitebox_tools.py | luzpaz/whitebox-tools | 55508fe0805e4cccec1c3fde46e4a1efacda5ad4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
''' This file is intended to be a helper for running whitebox-tools plugins from a Python script.
See whitebox_example.py for an example of how to use it.
'''
# This script is part of the WhiteboxTools geospatial library.
# Authors: Dr. John Lindsay
# Created: 28/11/2017
# Last Modified: 09/12/2... | 45.168018 | 247 | 0.622049 |
62f17d671b5f267350f259b23f006f63a8c832e6 | 3,770 | py | Python | methods/ALI.py | ericpts/OD-test-master | 82bdf234e69660d3c2e59c06062445196b865a79 | [
"MIT"
] | null | null | null | methods/ALI.py | ericpts/OD-test-master | 82bdf234e69660d3c2e59c06062445196b865a79 | [
"MIT"
] | null | null | null | methods/ALI.py | ericpts/OD-test-master | 82bdf234e69660d3c2e59c06062445196b865a79 | [
"MIT"
] | null | null | null | from __future__ import print_function
from os import path
from termcolor import colored
import torch
import torch.nn as nn
import torch.nn.functional as Fn
import torch.optim as optim
from torch.utils.data import DataLoader
from utils.iterative_trainer import IterativeTrainerConfig, IterativeTrainer
from utils.logger... | 32.5 | 87 | 0.633952 |
f70cb62b82822ffa1aaa43899d060bc7e23fed1e | 11,377 | py | Python | aoc2021/d18.py | jbudynek/advent-of-code | 16ab71b110e9766b445bce3d3172b11d421b2f75 | [
"CC0-1.0"
] | null | null | null | aoc2021/d18.py | jbudynek/advent-of-code | 16ab71b110e9766b445bce3d3172b11d421b2f75 | [
"CC0-1.0"
] | null | null | null | aoc2021/d18.py | jbudynek/advent-of-code | 16ab71b110e9766b445bce3d3172b11d421b2f75 | [
"CC0-1.0"
] | null | null | null | # coding: utf-8
import copy
from timeit import default_timer as timer
import numpy as np
# Main function
##########
class Pair:
def __init__(self, lhs, rhs, parent):
self.lhs = lhs
self.rhs = rhs
self.parent = parent
def __str__(self):
return "["+str(self.lhs)+","+str(self.r... | 24.466667 | 94 | 0.54452 |
2c27e96c4ad1f3c7499605a20004709283e8a357 | 53,464 | py | Python | tensorflow/python/framework/func_graph.py | ooohtv/tensorflow | 393717b02fc8638feac262965231889fbbb7045f | [
"Apache-2.0"
] | null | null | null | tensorflow/python/framework/func_graph.py | ooohtv/tensorflow | 393717b02fc8638feac262965231889fbbb7045f | [
"Apache-2.0"
] | null | null | null | tensorflow/python/framework/func_graph.py | ooohtv/tensorflow | 393717b02fc8638feac262965231889fbbb7045f | [
"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... | 41.444961 | 97 | 0.6963 |
cdab419bcbeea47a8af7529709b709b91a5cb739 | 6,497 | py | Python | servicecatalog_puppet/sdk.py | tv-17/aws-service-catalog-puppet | 8c6dc9e9a5737864359c77799b729813f707277c | [
"Apache-2.0"
] | null | null | null | servicecatalog_puppet/sdk.py | tv-17/aws-service-catalog-puppet | 8c6dc9e9a5737864359c77799b729813f707277c | [
"Apache-2.0"
] | null | null | null | servicecatalog_puppet/sdk.py | tv-17/aws-service-catalog-puppet | 8c6dc9e9a5737864359c77799b729813f707277c | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
from servicecatalog_puppet import core
def run(what="puppet", wait_for_completion=False):
"""
Run something
:param what: what should be run. The only parameter that will work is ``puppet``
... | 42.464052 | 120 | 0.761274 |
a2e51d5d8e524208b4c679a9fe50c53f51c154c5 | 6,108 | py | Python | aleph/logic/entities.py | jalmquist/aleph | 28a56bc7edd77dbd7910c94dac40916032edc177 | [
"MIT"
] | null | null | null | aleph/logic/entities.py | jalmquist/aleph | 28a56bc7edd77dbd7910c94dac40916032edc177 | [
"MIT"
] | 4 | 2021-09-08T02:07:35.000Z | 2022-03-12T00:33:46.000Z | aleph/logic/entities.py | jalmquist/aleph | 28a56bc7edd77dbd7910c94dac40916032edc177 | [
"MIT"
] | null | null | null | import logging
from banal import ensure_list
from pprint import pformat # noqa
from followthemoney import model
from followthemoney.graph import Node
from followthemoney.types import registry
from aleph.core import db, cache
from aleph.model import Entity, Document, Linkage
from aleph.index import entities as index
f... | 37.937888 | 77 | 0.683857 |
c5bd5765e1580bf721c6d53f4a963a13f756f65c | 609 | py | Python | leetcode/235_lowestCommonAncestor.py | thiakx/leetcode | cda5b3844331fb244c336bce7a551eafe946531d | [
"MIT"
] | null | null | null | leetcode/235_lowestCommonAncestor.py | thiakx/leetcode | cda5b3844331fb244c336bce7a551eafe946531d | [
"MIT"
] | null | null | null | leetcode/235_lowestCommonAncestor.py | thiakx/leetcode | cda5b3844331fb244c336bce7a551eafe946531d | [
"MIT"
] | null | null | null | class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
# reference: leetcode solns
class Solution:
def lowestCommonAncestor(self, root: 'TreeNode', p: 'TreeNode', q: 'TreeNode') -> 'TreeNode':
p_val = p.val
q_val = q.val
node = ro... | 26.478261 | 97 | 0.533662 |
3c63ce35e138bf3d9598713c193f13b8ab2f63a1 | 2,670 | py | Python | sdk/purview/azure-mgmt-purview/setup.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/purview/azure-mgmt-purview/setup.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/purview/azure-mgmt-purview/setup.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#----------------------------------------------------------------... | 35.6 | 103 | 0.609363 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.