hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 239 | max_forks_repo_name stringlengths 5 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7960689e5f960dd627d32cb0a4f1d06f6b3e2107 | 2,823 | py | Python | qz7/shell/ssh.py | parantapa/qz7-shell | 4c586543b07b9380c451cd15c695f3b268af2171 | [
"MIT"
] | null | null | null | qz7/shell/ssh.py | parantapa/qz7-shell | 4c586543b07b9380c451cd15c695f3b268af2171 | [
"MIT"
] | null | null | null | qz7/shell/ssh.py | parantapa/qz7-shell | 4c586543b07b9380c451cd15c695f3b268af2171 | [
"MIT"
] | null | null | null | """
Functions to connect to server via ssh.
"""
import os
import time
import logging
from contextlib import contextmanager
import paramiko
DEFAULT_RETRIES = 10
log = logging.getLogger(__name__)
def get_ssh_config():
"""
Load the ssh config file.
"""
ssh_config = paramiko.SSHConfig()
config_fna... | 23.923729 | 97 | 0.604676 |
796069fe80c1a0cd2471c33ad2dbbb66e41c6131 | 2,075 | py | Python | SimilarityClassification/Classifiers/GloveWordnetRetrofitClassifier.py | dudenzz/word_embedding | 7aa7c7619f8a56903384176f3d83e999153c55ce | [
"MIT"
] | null | null | null | SimilarityClassification/Classifiers/GloveWordnetRetrofitClassifier.py | dudenzz/word_embedding | 7aa7c7619f8a56903384176f3d83e999153c55ce | [
"MIT"
] | null | null | null | SimilarityClassification/Classifiers/GloveWordnetRetrofitClassifier.py | dudenzz/word_embedding | 7aa7c7619f8a56903384176f3d83e999153c55ce | [
"MIT"
] | null | null | null | __author__ = 'Asus'
__author__ = 'Asus'
from IClassifier import IClassifier
from utilities import load_stf
from glove import Glove
from scipy.spatial.distance import cosine
from scipy.spatial.distance import euclidean
from nltk.corpus import wordnet as wn
class GloveWordnetRetrofitClassifier(IClassifier):
... | 33.467742 | 101 | 0.506024 |
79606a5d7b4cc621d7272f25a4190d3495c087c0 | 866 | py | Python | fabfile.py | adewinter/bitpay-shopify | a3e9eb2b899c331e23f63b023c2d505519cdfbd0 | [
"MIT"
] | 1 | 2015-01-31T14:29:48.000Z | 2015-01-31T14:29:48.000Z | fabfile.py | adewinter/bitpay-shopify | a3e9eb2b899c331e23f63b023c2d505519cdfbd0 | [
"MIT"
] | null | null | null | fabfile.py | adewinter/bitpay-shopify | a3e9eb2b899c331e23f63b023c2d505519cdfbd0 | [
"MIT"
] | null | null | null | from fabric.api import *
env.hosts = ['base102.net']
env.user = 'adewinter'
def push_local():
local('git push origin master') # runs the command on the local environment
def pull_remote():
with cd('/opt/www/bitpay-shopify'):
run('whoami')
run('git pull origin master') # runs the command o... | 16.037037 | 83 | 0.662818 |
79606b1d8fb007ccc53779f188e20d0f325c0dfa | 784 | py | Python | polls/urls.py | dev-haykay/djapoll | 57d9f3952e95835a62d59f76eb0ec5ad051cdeb2 | [
"MIT"
] | null | null | null | polls/urls.py | dev-haykay/djapoll | 57d9f3952e95835a62d59f76eb0ec5ad051cdeb2 | [
"MIT"
] | null | null | null | polls/urls.py | dev-haykay/djapoll | 57d9f3952e95835a62d59f76eb0ec5ad051cdeb2 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from polls import views
from django.contrib.auth.decorators import login_required
app_name = 'polls'
urlpatterns = [
url(r'^$', login_required(views.IndexView.as_view()), name='index'),
url(r'^(?P<pk>[0-9]+)/$', login_required(views.DetailView.as_view()), name='detail'),
u... | 43.555556 | 90 | 0.672194 |
79606b6a41d799df8ee94b4a01a6ddb8b208a85b | 164 | py | Python | uno/uno/asgi.py | ramonduarte/sampleblog | ac432be729d645e58c27590c868af49dde2e39c7 | [
"MIT"
] | null | null | null | uno/uno/asgi.py | ramonduarte/sampleblog | ac432be729d645e58c27590c868af49dde2e39c7 | [
"MIT"
] | null | null | null | uno/uno/asgi.py | ramonduarte/sampleblog | ac432be729d645e58c27590c868af49dde2e39c7 | [
"MIT"
] | null | null | null | import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'uno.settings')
application = get_asgi_application()
| 20.5 | 63 | 0.823171 |
79606b7c09e26990729e417192dcce62576a09c3 | 5,032 | py | Python | tests/app/provider_details/test_rest.py | alphagov/notifications-api | 494a01ba57aeb46d3622b4895a1373a3cc47371c | [
"MIT"
] | 51 | 2016-04-03T23:36:17.000Z | 2022-03-21T20:04:52.000Z | tests/app/provider_details/test_rest.py | alphagov/notifications-api | 494a01ba57aeb46d3622b4895a1373a3cc47371c | [
"MIT"
] | 1,335 | 2015-12-15T14:28:50.000Z | 2022-03-30T16:24:27.000Z | tests/app/provider_details/test_rest.py | alphagov/notifications-api | 494a01ba57aeb46d3622b4895a1373a3cc47371c | [
"MIT"
] | 30 | 2016-01-08T19:05:32.000Z | 2021-12-20T16:37:23.000Z | import pytest
from flask import json
from freezegun import freeze_time
from app.models import ProviderDetails, ProviderDetailsHistory
from tests import create_admin_authorization_header
from tests.app.db import create_ft_billing
def test_get_provider_details_returns_all_providers(admin_request, notify_db_session):
... | 36.729927 | 104 | 0.701113 |
79606d6834c2020b2a93a769a29aa90e175c047a | 1,099 | py | Python | tools/perf/benchmarks/rasterize_and_record.py | iplo/Chain | 8bc8943d66285d5258fffc41bed7c840516c4422 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 231 | 2015-01-08T09:04:44.000Z | 2021-12-30T03:03:10.000Z | tools/perf/benchmarks/rasterize_and_record.py | j4ckfrost/android_external_chromium_org | a1a3dad8b08d1fcf6b6b36c267158ed63217c780 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2017-02-14T21:55:58.000Z | 2017-02-14T21:55:58.000Z | tools/perf/benchmarks/rasterize_and_record.py | j4ckfrost/android_external_chromium_org | a1a3dad8b08d1fcf6b6b36c267158ed63217c780 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 268 | 2015-01-21T05:53:28.000Z | 2022-03-25T22:09:01.000Z | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry import test
from measurements import rasterize_and_record
class RasterizeAndRecordTop25(test.Test):
"""Measures rasterize and record perfo... | 35.451613 | 77 | 0.799818 |
79606d6fd09caa80d40c36323042d009799a9379 | 19,662 | py | Python | src/snc/simulation/validation_script.py | dmcnamee/snc | c2da8c1e9ecdc42c59b9de73224b3d50ee1c9786 | [
"Apache-2.0"
] | 5 | 2021-03-24T16:23:10.000Z | 2021-11-17T12:44:51.000Z | src/snc/simulation/validation_script.py | dmcnamee/snc | c2da8c1e9ecdc42c59b9de73224b3d50ee1c9786 | [
"Apache-2.0"
] | 3 | 2021-03-26T01:16:08.000Z | 2021-05-08T22:06:47.000Z | src/snc/simulation/validation_script.py | dmcnamee/snc | c2da8c1e9ecdc42c59b9de73224b3d50ee1c9786 | [
"Apache-2.0"
] | 2 | 2021-03-24T17:20:06.000Z | 2021-04-19T09:01:12.000Z | import argparse
import ast
from datetime import datetime
import json
import matplotlib.pyplot as plt
import numpy as np
import os
import time
from typing import Optional, Dict, Union, List
from warnings import warn
from experiment.experiment_utils import get_args_string
import snc
from snc.agents.hedgehog.hh_agents.bi... | 50.675258 | 100 | 0.670227 |
79606ed6dfe985bff9f274b94288193f88400c34 | 807 | py | Python | Challenge026.py | lilimonroy/stringsStatementsChallenges020-026 | 0bca641e3e61b67feda103ed0f99ac4d4cdf484a | [
"MIT"
] | null | null | null | Challenge026.py | lilimonroy/stringsStatementsChallenges020-026 | 0bca641e3e61b67feda103ed0f99ac4d4cdf484a | [
"MIT"
] | null | null | null | Challenge026.py | lilimonroy/stringsStatementsChallenges020-026 | 0bca641e3e61b67feda103ed0f99ac4d4cdf484a | [
"MIT"
] | null | null | null | #----------* CHALLENGE 26 *----------
#Pig Latin takes the first consonant of a word, moves it to the end of the word and adds on an “ay”. If a word begins with a vowel you just add
# “way” to the end. For example, pig becomes igpay, banana becomes ananabay, and aadvark becomes aadvarkway. Create a program that will ... | 50.4375 | 200 | 0.680297 |
79606f0cbbe5a03ddc94f915be91e71356d85571 | 2,026 | py | Python | geeksw/utils/array_utils.py | guitargeek/geeksw | d6e774824eae713e68cf23ae242933be9df52fcf | [
"MIT"
] | 2 | 2019-04-11T22:26:29.000Z | 2021-06-23T19:59:36.000Z | geeksw/utils/array_utils.py | guitargeek/geeksw | d6e774824eae713e68cf23ae242933be9df52fcf | [
"MIT"
] | null | null | null | geeksw/utils/array_utils.py | guitargeek/geeksw | d6e774824eae713e68cf23ae242933be9df52fcf | [
"MIT"
] | null | null | null | import numpy as np
import awkward
def awk_singleton(arr):
return awkward.JaggedArray.fromcounts(np.ones(len(arr), dtype=np.int), arr)
def awksel(arr, selections, mask=None):
if not mask is None:
arr = arr[mask]
for s in selections:
arr = arr[awk_singleton(s[mask])].flatten()
... | 28.535211 | 97 | 0.559724 |
79606f549468c472e5cb2231db636cc9b8a29cfd | 1,724 | py | Python | Plots/purity_of_rand_density.py | KwiatQIM/Quantum-Tomography | e10d03b9dc5c8c1bb61a081db1aef70a4b2bb6ca | [
"MIT"
] | 11 | 2020-06-23T13:44:30.000Z | 2021-10-22T02:55:14.000Z | Plots/purity_of_rand_density.py | KwiatQIM/Quantum-Tomography | e10d03b9dc5c8c1bb61a081db1aef70a4b2bb6ca | [
"MIT"
] | 3 | 2020-06-23T00:09:46.000Z | 2021-09-12T23:25:05.000Z | Plots/purity_of_rand_density.py | KwiatQIM/Quantum-Tomography | e10d03b9dc5c8c1bb61a081db1aef70a4b2bb6ca | [
"MIT"
] | 4 | 2020-08-11T09:11:17.000Z | 2021-11-06T05:47:47.000Z | import QuantumTomography as qLib
import numpy as np
import matplotlib.pyplot as plt
numSamples = 100000
numBins = 40
purities1 = np.zeros(numSamples)
purities2 = np.zeros(numSamples)
for i in range(numSamples):
state1 = qLib.random_density_state(1)
purities1[i] = qLib.purity(state1)
state2 = qLib.rando... | 31.345455 | 72 | 0.679234 |
79606fbcce2050fd1bcb6add131230f2ed1b4254 | 4,928 | py | Python | pytest_monitor/sys_utils.py | ErnestinaQiu/pytest-monitor | 8e0fe5291acd94d301a66c75977d030f7ec135a7 | [
"MIT"
] | null | null | null | pytest_monitor/sys_utils.py | ErnestinaQiu/pytest-monitor | 8e0fe5291acd94d301a66c75977d030f7ec135a7 | [
"MIT"
] | null | null | null | pytest_monitor/sys_utils.py | ErnestinaQiu/pytest-monitor | 8e0fe5291acd94d301a66c75977d030f7ec135a7 | [
"MIT"
] | null | null | null | import hashlib
import multiprocessing
import os
import platform
import psutil
import socket
import subprocess
import sys
def collect_ci_info():
d = dict()
# Test for jenkins
if "BUILD_NUMBER" in os.environ:
if "BRANCH_NAME" in os.environ or "JOB_NAME" in os.environ:
br = os.environ["BR... | 34.222222 | 117 | 0.617898 |
7960705ad8eb42df89b26ce282245f17ccd1abcd | 3,508 | py | Python | setup.py | Moritz-Alexander-Kern/elephant-1 | 6ed3cb3089783035885e2fbec1fff535df7369cd | [
"BSD-3-Clause"
] | null | null | null | setup.py | Moritz-Alexander-Kern/elephant-1 | 6ed3cb3089783035885e2fbec1fff535df7369cd | [
"BSD-3-Clause"
] | null | null | null | setup.py | Moritz-Alexander-Kern/elephant-1 | 6ed3cb3089783035885e2fbec1fff535df7369cd | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import os.path
import platform
from setuptools import setup, Extension
with open(os.path.join(os.path.dirname(__file__),
"elephant", "VERSION")) as version_file:
version = version_file.read().strip()
with open("README.md") as f:
long_description = f.read()
with ... | 38.549451 | 100 | 0.608609 |
7960714f399b507286cffa7737a8e4cc1094914f | 31,975 | py | Python | 台海舆论-数据分析(可视化系统)/demo/Terrace_Line.py | 13060923171/Crawl-Project2 | effab1bf31979635756fc272a7bcc666bb499be2 | [
"MIT"
] | 14 | 2020-10-27T05:52:20.000Z | 2021-11-07T20:24:55.000Z | 台海舆论-数据分析(可视化系统)/demo/Terrace_Line.py | 13060923171/Crawl-Project2 | effab1bf31979635756fc272a7bcc666bb499be2 | [
"MIT"
] | 1 | 2021-09-17T07:40:00.000Z | 2021-09-17T07:40:00.000Z | 台海舆论-数据分析(可视化系统)/demo/Terrace_Line.py | 13060923171/Crawl-Project2 | effab1bf31979635756fc272a7bcc666bb499be2 | [
"MIT"
] | 8 | 2020-11-18T14:23:12.000Z | 2021-11-12T08:55:08.000Z | import pandas as pd
import pyecharts.options as opts
from pyecharts.charts import Line
from pyecharts.globals import ThemeType
def weibo_sum():
df1 = pd.read_excel('./台湾文本-数据/微博/微博台海局势1-12月/1.xlsx').loc[:,['from']]
sum_weibo = []
for d1 in df1['from']:
d1 = str(d1)
d1 = d1[0:8]
sum_... | 29.688951 | 157 | 0.495981 |
796071781d50ea2f95665245d2a7a3661483eed3 | 1,562 | py | Python | gdc_client/query/versions.py | hepoo6/gdc-client | 4453c6412aca55bcc458d710de148a4cabf95cd6 | [
"Apache-2.0"
] | null | null | null | gdc_client/query/versions.py | hepoo6/gdc-client | 4453c6412aca55bcc458d710de148a4cabf95cd6 | [
"Apache-2.0"
] | null | null | null | gdc_client/query/versions.py | hepoo6/gdc-client | 4453c6412aca55bcc458d710de148a4cabf95cd6 | [
"Apache-2.0"
] | null | null | null | """gdc_client.query.versions
Functionality related to versioning.
"""
import logging
import requests
logger = logging.getLogger(__name__)
def get_latest_versions(url, uuids):
"""Get the latest version of a UUID according to the api.
Args:
url (str):
uuids (list): list of UUIDs that might ... | 26.033333 | 76 | 0.643406 |
796072f433097bb798b623eef56f890ed2d7baac | 29,470 | py | Python | uresnet/utils.py | ranitay/SparseSSNet | ba0eff8b7ef9bbf5b68bea37d6f4d1dc7d3673ab | [
"MIT"
] | null | null | null | uresnet/utils.py | ranitay/SparseSSNet | ba0eff8b7ef9bbf5b68bea37d6f4d1dc7d3673ab | [
"MIT"
] | null | null | null | uresnet/utils.py | ranitay/SparseSSNet | ba0eff8b7ef9bbf5b68bea37d6f4d1dc7d3673ab | [
"MIT"
] | 1 | 2021-04-29T13:00:08.000Z | 2021-04-29T13:00:08.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import torch
from sklearn.cluster import DBSCAN
import matplotlib
from sklearn.metrics import log_loss
from scipy.spatial.distance import cdist
from sklearn.cluster import DBSCAN
class CSVDa... | 59.776876 | 232 | 0.584696 |
7960742b07bbef88d34099a049888574a2f3248c | 2,410 | py | Python | salesman/admin/utils.py | icvntechstudio/django-salesman | 017dd31713e37a445500c18e0c7034608f4f62a7 | [
"BSD-3-Clause"
] | 222 | 2020-02-03T16:58:56.000Z | 2022-03-30T16:35:35.000Z | salesman/admin/utils.py | icvntechstudio/django-salesman | 017dd31713e37a445500c18e0c7034608f4f62a7 | [
"BSD-3-Clause"
] | 16 | 2020-03-17T12:38:27.000Z | 2022-03-16T13:14:55.000Z | salesman/admin/utils.py | icvntechstudio/django-salesman | 017dd31713e37a445500c18e0c7034608f4f62a7 | [
"BSD-3-Clause"
] | 23 | 2020-08-28T04:46:33.000Z | 2022-01-12T21:57:39.000Z | import json
from decimal import Decimal
from django.contrib.auth import get_user_model
from django.http import HttpRequest
from django.urls import NoReverseMatch, reverse
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from rest_framework.compat import pygments_css, pygments_hig... | 29.036145 | 84 | 0.648548 |
796074453119490b02c9bd11721c7d488f44deda | 684 | py | Python | blue/update.py | onexi/threetiers | 0a72eb1c38586ed03d75c4198f884170460576a4 | [
"MIT"
] | null | null | null | blue/update.py | onexi/threetiers | 0a72eb1c38586ed03d75c4198f884170460576a4 | [
"MIT"
] | null | null | null | blue/update.py | onexi/threetiers | 0a72eb1c38586ed03d75c4198f884170460576a4 | [
"MIT"
] | null | null | null | from flask import Blueprint, render_template, request, redirect
from database import mysql
# blueprint setup
update = Blueprint('update', __name__)
@update.route('/update')
def default():
college = {}
college['id'] = request.args.get('id')
college['name'] = request.args.get('name')
return render_t... | 29.73913 | 76 | 0.676901 |
79607479aa14fba82b4ee968f3e9c18c2db12a93 | 13,474 | py | Python | dwave/embedding/transforms.py | wbernoudy/dwave-system | 21be9a868a156cb3d8f929285d67470331da8ad8 | [
"Apache-2.0"
] | null | null | null | dwave/embedding/transforms.py | wbernoudy/dwave-system | 21be9a868a156cb3d8f929285d67470331da8ad8 | [
"Apache-2.0"
] | null | null | null | dwave/embedding/transforms.py | wbernoudy/dwave-system | 21be9a868a156cb3d8f929285d67470331da8ad8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 D-Wave Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 38.718391 | 113 | 0.60754 |
7960747f482e2eff0c9937c36d5d0d166642f4d2 | 1,355 | py | Python | omnim/src/metrics/leadtime.py | khru/omni-metric | e8a1b0ae8f968d42ffd5b4cb9384b0b4a30d5d36 | [
"MIT"
] | null | null | null | omnim/src/metrics/leadtime.py | khru/omni-metric | e8a1b0ae8f968d42ffd5b4cb9384b0b4a30d5d36 | [
"MIT"
] | null | null | null | omnim/src/metrics/leadtime.py | khru/omni-metric | e8a1b0ae8f968d42ffd5b4cb9384b0b4a30d5d36 | [
"MIT"
] | null | null | null | import datetime
from omnim.src.events import EventType
from omnim.src.metrics.metric_result import LeadtimeMetricResult
class LeadtimeMetricCalculator:
def calculate(self, events=()):
average_lead_time = None
total_time = datetime.timedelta()
deploys_count = 0
pipelines = {}
... | 30.795455 | 88 | 0.608118 |
796074a21717f36f4e98d264eb04a8c5ae9316c6 | 6,645 | py | Python | vmware/nsx/tests/TestNsxEdge.py | arielik/devops-utils | 70f0e011030fd9e4e9fd30e2ab3f204069aa33ef | [
"BSD-2-Clause"
] | 1 | 2017-02-10T13:19:51.000Z | 2017-02-10T13:19:51.000Z | vmware/nsx/tests/TestNsxEdge.py | arielik/devops-utils | 70f0e011030fd9e4e9fd30e2ab3f204069aa33ef | [
"BSD-2-Clause"
] | 1 | 2019-04-05T00:38:31.000Z | 2019-04-05T13:10:16.000Z | vmware/nsx/tests/TestNsxEdge.py | FibercorpLabs/FibercorpDevops | 70f0e011030fd9e4e9fd30e2ab3f204069aa33ef | [
"BSD-2-Clause"
] | 1 | 2019-08-08T23:09:43.000Z | 2019-08-08T23:09:43.000Z | # tests/TestNsxEdges.py
import unittest
import sys
sys.path.append("../utils/nsx/")
from edge import *
class NsxEdgeCreateDeleteTestCase(unittest.TestCase):
def test_createNsxEdge(self):
jinja_vars = { "datacenterMoid" : 'datacenter-2',
"name" : 'Edge-Test',
... | 44.898649 | 1,302 | 0.559368 |
7960754cfd66f4df9fa70e7bf2f63db5118545c2 | 7,354 | py | Python | examples/sites/holoviews/holoviews/plotting/bokeh/path.py | dipesh1432/nbsite | 866c6d747879b9a4b88e0a30a43e35b9802645bd | [
"BSD-3-Clause"
] | 15 | 2018-04-06T19:13:26.000Z | 2019-05-24T04:08:51.000Z | examples/sites/holoviews/holoviews/plotting/bokeh/path.py | dipesh1432/nbsite | 866c6d747879b9a4b88e0a30a43e35b9802645bd | [
"BSD-3-Clause"
] | 71 | 2018-03-09T16:32:59.000Z | 2019-07-09T19:45:36.000Z | examples/sites/holoviews/holoviews/plotting/bokeh/path.py | dipesh1432/nbsite | 866c6d747879b9a4b88e0a30a43e35b9802645bd | [
"BSD-3-Clause"
] | 23 | 2019-12-13T17:38:46.000Z | 2021-09-08T14:37:26.000Z | from collections import defaultdict
import param
import numpy as np
from bokeh.models import HoverTool, FactorRange
from ...core import util
from .element import ColorbarPlot, LegendPlot, line_properties, fill_properties
from .util import expand_batched_style
class PathPlot(ColorbarPlot):
color_index = param.... | 39.326203 | 96 | 0.596546 |
796075a38b38dc78bc1a5e7e8f9a92c705e17f4b | 15,792 | py | Python | corehq/apps/ota/views.py | tstalka/commcare-hq | 902412b0f97ba0daac173fe284f3adc4c01bcd76 | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/ota/views.py | tstalka/commcare-hq | 902412b0f97ba0daac173fe284f3adc4c01bcd76 | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/ota/views.py | tstalka/commcare-hq | 902412b0f97ba0daac173fe284f3adc4c01bcd76 | [
"BSD-3-Clause"
] | null | null | null | import os
from datetime import datetime
from distutils.version import LooseVersion
from django.conf import settings
from django.http import (
Http404,
HttpResponse,
HttpResponseBadRequest,
JsonResponse,
)
from django.utils.translation import ugettext as _
from django.views.decorators.csrf import csrf_e... | 38.144928 | 113 | 0.713019 |
796076b01d9d37aec7e09b6f0e1161590d266306 | 15,068 | py | Python | rllib/agents/es/es.py | linyiyue/ray | 90d2456ec70270a1f894ec3ef6f3004533859e03 | [
"Apache-2.0"
] | 21,382 | 2016-09-26T23:12:52.000Z | 2022-03-31T21:47:45.000Z | rllib/agents/es/es.py | linyiyue/ray | 90d2456ec70270a1f894ec3ef6f3004533859e03 | [
"Apache-2.0"
] | 19,689 | 2016-09-17T08:21:25.000Z | 2022-03-31T23:59:30.000Z | rllib/agents/es/es.py | linyiyue/ray | 90d2456ec70270a1f894ec3ef6f3004533859e03 | [
"Apache-2.0"
] | 4,114 | 2016-09-23T18:54:01.000Z | 2022-03-31T15:07:32.000Z | # Code in this file is copied and adapted from
# https://github.com/openai/evolution-strategies-starter.
from collections import namedtuple
import logging
import numpy as np
import random
import time
import ray
from ray.rllib.agents import Trainer, with_common_config
from ray.rllib.agents.es import optimizers, utils
... | 36.75122 | 79 | 0.626161 |
7960778bce9fff20ae6042c73173d66d0aa785ac | 12,855 | py | Python | tfx/orchestration/experimental/core/async_pipeline_task_gen_test.py | Mikehem/tfx | e803ea6778d8550ec77dcc92bc8172f1a3a90f38 | [
"Apache-2.0"
] | null | null | null | tfx/orchestration/experimental/core/async_pipeline_task_gen_test.py | Mikehem/tfx | e803ea6778d8550ec77dcc92bc8172f1a3a90f38 | [
"Apache-2.0"
] | null | null | null | tfx/orchestration/experimental/core/async_pipeline_task_gen_test.py | Mikehem/tfx | e803ea6778d8550ec77dcc92bc8172f1a3a90f38 | [
"Apache-2.0"
] | null | null | null | # Lint as: python2, python3
# Copyright 2020 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | 42.009804 | 80 | 0.679891 |
7960786a594c99e11aeac51ac977f0be0b998276 | 253 | py | Python | manage.py | philmui/ultralists | 42a4711ec2bcb9f1d04e4e622c33572d152bbd95 | [
"MIT"
] | null | null | null | manage.py | philmui/ultralists | 42a4711ec2bcb9f1d04e4e622c33572d152bbd95 | [
"MIT"
] | null | null | null | manage.py | philmui/ultralists | 42a4711ec2bcb9f1d04e4e622c33572d152bbd95 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ultralists.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 23 | 74 | 0.774704 |
796079440b30c4330ae130d38c33f5fdf9fe9465 | 12,582 | py | Python | novelty-detection/train_mnist.py | matherm/python-data-science | bdb49b18c5ef6044f8a9e6f95c81d5f7bb1d511f | [
"MIT"
] | 1 | 2020-03-24T09:22:04.000Z | 2020-03-24T09:22:04.000Z | novelty-detection/train_mnist.py | matherm/python-data-science | bdb49b18c5ef6044f8a9e6f95c81d5f7bb1d511f | [
"MIT"
] | 1 | 2020-06-16T14:42:29.000Z | 2020-06-16T14:42:29.000Z | novelty-detection/train_mnist.py | matherm/python-data-science | bdb49b18c5ef6044f8a9e6f95c81d5f7bb1d511f | [
"MIT"
] | null | null | null | import argparse
import sys
import torch
import numpy as np
import torch.nn as nn
from torch.utils.data import DataLoader
from torchvision.datasets import MNIST
from torchvision.datasets import CIFAR10
import torchvision.transforms as transforms
parser = argparse.ArgumentParser(description='PyTorch Novelty Detection')
... | 34.565934 | 131 | 0.545541 |
79607a35734b182b3d1e5ad18c642d24675f963f | 9,184 | py | Python | gs_quant/test/timeseries/test_measures_risk_models.py | mlize/gs-quant | 13aba5c362f4f9f8a78ca9288c5a3e026160ce55 | [
"Apache-2.0"
] | 2 | 2021-06-22T12:14:38.000Z | 2021-06-23T15:51:08.000Z | gs_quant/test/timeseries/test_measures_risk_models.py | mlize/gs-quant | 13aba5c362f4f9f8a78ca9288c5a3e026160ce55 | [
"Apache-2.0"
] | null | null | null | gs_quant/test/timeseries/test_measures_risk_models.py | mlize/gs-quant | 13aba5c362f4f9f8a78ca9288c5a3e026160ce55 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 Goldman Sachs.
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 di... | 34.397004 | 105 | 0.633711 |
79607a9bdc4baa6f10239bc07bedf539908469dc | 2,337 | py | Python | cnn-registration/shape_context.py | JSYdiyishuai/Image-registration-methods | d89e5941761a1f7bfec3bdea5508c3f9db45dbc6 | [
"MIT"
] | 4 | 2021-06-02T10:23:08.000Z | 2022-03-24T10:59:25.000Z | cnn-registration/shape_context.py | JSYdiyishuai/Image-registration-methods | d89e5941761a1f7bfec3bdea5508c3f9db45dbc6 | [
"MIT"
] | null | null | null | cnn-registration/shape_context.py | JSYdiyishuai/Image-registration-methods | d89e5941761a1f7bfec3bdea5508c3f9db45dbc6 | [
"MIT"
] | 1 | 2021-07-13T01:26:13.000Z | 2021-07-13T01:26:13.000Z | from numpy import *
import math
from utils import pairwise_distance
seterr(all='ignore')
def logspace(d1, d2, n):
sp = zeros(n)
k = arange(n-1)
sp[:n-1] = 10 ** (d1 + k * (d2 - d1) / (n - 1))
sp[n-1] = 10 ** d2
return sp
def get_angle(p1, p2):
"""Return angle in radians"""
return math.at... | 26.258427 | 89 | 0.514335 |
79607c401fb498770c0f4ed361530d94075a171e | 1,510 | py | Python | setup.py | mwang87/spec2vec-1 | a2a153409198468c994eed456adfb9964f5c2be4 | [
"Apache-2.0"
] | null | null | null | setup.py | mwang87/spec2vec-1 | a2a153409198468c994eed456adfb9964f5c2be4 | [
"Apache-2.0"
] | null | null | null | setup.py | mwang87/spec2vec-1 | a2a153409198468c994eed456adfb9964f5c2be4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
from setuptools import setup
from setuptools import find_packages
here = os.path.abspath(os.path.dirname(__file__))
version = {}
with open(os.path.join(here, "spec2vec", "__version__.py")) as f:
exec(f.read(), version)
with open("README.rst") as readme_file:
readme = readme_f... | 26.964286 | 79 | 0.638411 |
79607c9bb913b11d1fc0ba88cce6eb28a93fed37 | 12,425 | py | Python | mite/__main__.py | tonysimpson/mite | 2a99a7b05204de444006e57e2c66e9f87fbcc357 | [
"MIT"
] | 1 | 2017-11-19T21:43:55.000Z | 2017-11-19T21:43:55.000Z | mite/__main__.py | tonysimpson/mite | 2a99a7b05204de444006e57e2c66e9f87fbcc357 | [
"MIT"
] | null | null | null | mite/__main__.py | tonysimpson/mite | 2a99a7b05204de444006e57e2c66e9f87fbcc357 | [
"MIT"
] | null | null | null | """\
Mite Load Test Framewwork.
Usage:
mite [options] scenario test SCENARIO_SPEC
mite [options] journey test JOURNEY_SPEC [DATAPOOL_SPEC]
mite [options] controller SCENARIO_SPEC [--message-socket=SOCKET] [--controller-socket=SOCKET]
mite [options] runner [--message-socket=SOCKET] [--controller-socket=... | 34.418283 | 154 | 0.700282 |
79607ca860d0e19cd8f8f304db0cd7260523c795 | 542 | py | Python | django_experiment/simplesocial/views.py | prakashgowinji/Django_experiment | e8c9007b7b9ed3e766e800acb9f64963b2f2633b | [
"Apache-2.0"
] | null | null | null | django_experiment/simplesocial/views.py | prakashgowinji/Django_experiment | e8c9007b7b9ed3e766e800acb9f64963b2f2633b | [
"Apache-2.0"
] | null | null | null | django_experiment/simplesocial/views.py | prakashgowinji/Django_experiment | e8c9007b7b9ed3e766e800acb9f64963b2f2633b | [
"Apache-2.0"
] | null | null | null | from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.views.generic import TemplateView
class TestPage(TemplateView):
template_name = 'test.html'
class ThanksPage(TemplateView):
template_name = 'thanks.html'
class HomePage(TemplateView):
template_name = "in... | 30.111111 | 66 | 0.734317 |
79607d9eed4eea3b40ea5bea542e8b4bd515494d | 6,367 | py | Python | tests/fake_fs/__init__.py | borikinternet/nurse | 161b0c9ff5df2b231052a8e3dd5ac575005a9cd9 | [
"MIT"
] | null | null | null | tests/fake_fs/__init__.py | borikinternet/nurse | 161b0c9ff5df2b231052a8e3dd5ac575005a9cd9 | [
"MIT"
] | null | null | null | tests/fake_fs/__init__.py | borikinternet/nurse | 161b0c9ff5df2b231052a8e3dd5ac575005a9cd9 | [
"MIT"
] | null | null | null | # Copyright (c) 2020. borik.internet@gmail.com
#
# 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, merg... | 38.587879 | 98 | 0.621486 |
79607e2f11f4a731b5ce35fe267bdc683755c662 | 315 | py | Python | Python/Reverse String.py | sattwik21/Hacktoberfest2021-1 | 74c8edd54f9c967c0f301f74dec31526dffa8222 | [
"MIT"
] | 215 | 2021-10-01T08:18:16.000Z | 2022-03-29T04:12:03.000Z | Python/Reverse String.py | sattwik21/Hacktoberfest2021-1 | 74c8edd54f9c967c0f301f74dec31526dffa8222 | [
"MIT"
] | 51 | 2021-10-01T08:16:42.000Z | 2021-10-31T13:51:51.000Z | Python/Reverse String.py | sattwik21/Hacktoberfest2021-1 | 74c8edd54f9c967c0f301f74dec31526dffa8222 | [
"MIT"
] | 807 | 2021-10-01T08:11:45.000Z | 2021-11-21T18:57:09.000Z | #reverse a string using reversed()
def reverse(str):
string = "".join(reversed(str)) # reversed() function inside the join() function
return string
s = input("Enter a string: ")
print ("The original string is : ",s)
print ("The reversed string using reversed() is : ",reverse(s) )
| 28.636364 | 86 | 0.628571 |
79607fc625ad6cafee8b593f21db637468edfd2e | 2,430 | py | Python | setup.py | bwarren2/dj-bootstrap-swatches | 3eb9281bb3a7770a23b2e1341930634dd700073d | [
"MIT"
] | null | null | null | setup.py | bwarren2/dj-bootstrap-swatches | 3eb9281bb3a7770a23b2e1341930634dd700073d | [
"MIT"
] | 1 | 2017-05-27T02:47:35.000Z | 2017-05-27T02:47:35.000Z | setup.py | bwarren2/dj-bootstrap-swatches | 3eb9281bb3a7770a23b2e1341930634dd700073d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def get_version(*file_paths):
"""Retrieves the version from dj_bootstrap_swatches/__init__.py"""
filename = os.path.join(os.path.dirname(... | 30.375 | 70 | 0.613992 |
796080066a1ebea3db6fcfe7c044e2f2c219a5f0 | 2,560 | py | Python | settings/high_speed_chopper_modes_settings.py | bopopescu/Lauecollect | 60ae2b05ea8596ba0decf426e37aeaca0bc8b6be | [
"MIT"
] | null | null | null | settings/high_speed_chopper_modes_settings.py | bopopescu/Lauecollect | 60ae2b05ea8596ba0decf426e37aeaca0bc8b6be | [
"MIT"
] | 1 | 2019-10-22T21:28:31.000Z | 2019-10-22T21:39:12.000Z | settings/high_speed_chopper_modes_settings.py | bopopescu/Lauecollect | 60ae2b05ea8596ba0decf426e37aeaca0bc8b6be | [
"MIT"
] | 2 | 2019-06-06T15:06:46.000Z | 2020-07-20T02:03:22.000Z | line0.timing_system.channels.hsc.delay = 4.97e-06
line0.Phase [s] = 5.4527e-06
line0.ChopX = 33.79
line0.ChopY = 30.17
line0.description = 'S-1t'
line0.updated = '17 Oct 15:03'
line1.timing_system.channels.hsc.delay = 0.0
line1.ChopX = 37.28
line1.ChopY = 30.925
line1.description = 'S-1'
line1.updated = '17 Oct 15:05'
... | 32 | 91 | 0.732031 |
7960801277784409e8be96cd4e0e7304efeb6b75 | 3,169 | py | Python | project_euler/problem_008/sol1.py | NavpreetDevpuri/Python | 7ef5ae66d777e8ed702993c6aa9270e0669cb0c6 | [
"MIT"
] | 145,614 | 2016-07-21T05:40:05.000Z | 2022-03-31T22:17:22.000Z | project_euler/problem_008/sol1.py | Agha-Muqarib/Python | 04f156a8973d6156a4357e0717d9eb0aa264d086 | [
"MIT"
] | 3,987 | 2016-07-28T17:31:25.000Z | 2022-03-30T23:07:46.000Z | project_euler/problem_008/sol1.py | Agha-Muqarib/Python | 04f156a8973d6156a4357e0717d9eb0aa264d086 | [
"MIT"
] | 40,014 | 2016-07-26T15:14:41.000Z | 2022-03-31T22:23:03.000Z | """
Project Euler Problem 8: https://projecteuler.net/problem=8
Largest product in a series
The four adjacent digits in the 1000-digit number that have the greatest
product are 9 × 9 × 8 × 9 = 5832.
73167176531330624919225119674426574742355349194934
96983520312774506326239578318016984801869478851843
8586... | 38.180723 | 74 | 0.84443 |
7960802af063ca4bbdb2c2ca5adb0598ac9bb22e | 4,195 | py | Python | sorl/thumbnail/conf/defaults.py | frmdstryr/sorl-thumbnail | f2e3baaf7621fdf4201bc923406b8464351babc7 | [
"BSD-3-Clause"
] | null | null | null | sorl/thumbnail/conf/defaults.py | frmdstryr/sorl-thumbnail | f2e3baaf7621fdf4201bc923406b8464351babc7 | [
"BSD-3-Clause"
] | null | null | null | sorl/thumbnail/conf/defaults.py | frmdstryr/sorl-thumbnail | f2e3baaf7621fdf4201bc923406b8464351babc7 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
from django.conf import settings
# When True ThumbnailNode.render can raise errors
THUMBNAIL_DEBUG = False
# Backend
THUMBNAIL_BACKEND = 'sorl.thumbnail.base.ThumbnailBackend'
# Key-value store, ships with:
# sorl.thumbnail.kvstores.cached_db_kvstore.KVStore
# sorl.thumbnail.k... | 32.269231 | 98 | 0.793802 |
796080f6c99aedb841d37862a66fd05a00bf42e9 | 727 | py | Python | portfolio/models.py | ralphiecodes/my_portfolio | a625e9c3638605fc26dbb97a81881517a9778387 | [
"MIT",
"Unlicense"
] | 1 | 2021-08-09T16:46:30.000Z | 2021-08-09T16:46:30.000Z | portfolio/models.py | ralphiecodes/my_portfolio | a625e9c3638605fc26dbb97a81881517a9778387 | [
"MIT",
"Unlicense"
] | null | null | null | portfolio/models.py | ralphiecodes/my_portfolio | a625e9c3638605fc26dbb97a81881517a9778387 | [
"MIT",
"Unlicense"
] | null | null | null | from django.db import models
class Project(models.Model):
title = models.CharField(max_length=100)
description = models.CharField(max_length=300)
image = models.ImageField(upload_to='portfolio/images/')
github_url = models.URLField(blank=True)
website_url = models.URLField(blank=True)
detail_on... | 40.388889 | 62 | 0.751032 |
79608128bc68d0c771cbedc8212606c2288ac748 | 6,920 | py | Python | ngraph/test/frontend/paddlepaddle/test_models/gen_scripts/generate_conv2d_transpose.py | monroid/openvino | 8272b3857ef5be0aaa8abbf7bd0d5d5615dc40b6 | [
"Apache-2.0"
] | 2,406 | 2020-04-22T15:47:54.000Z | 2022-03-31T10:27:37.000Z | ngraph/test/frontend/paddlepaddle/test_models/gen_scripts/generate_conv2d_transpose.py | thomas-yanxin/openvino | 031e998a15ec738c64cc2379d7f30fb73087c272 | [
"Apache-2.0"
] | 4,948 | 2020-04-22T15:12:39.000Z | 2022-03-31T18:45:42.000Z | ngraph/test/frontend/paddlepaddle/test_models/gen_scripts/generate_conv2d_transpose.py | thomas-yanxin/openvino | 031e998a15ec738c64cc2379d7f30fb73087c272 | [
"Apache-2.0"
] | 991 | 2020-04-23T18:21:09.000Z | 2022-03-31T18:40:57.000Z | import numpy as np
import paddle as pdpd
pdpd.enable_static()
from save_model import saveModel
import sys
def run_and_save_model(input_x, name, feed, fetch_list, main_prog, start_prog):
cpu = pdpd.static.cpu_places(1)
exe = pdpd.static.Executor(cpu[0])
exe.run(start_prog)
outs = exe.run(
feed=... | 47.724138 | 149 | 0.39422 |
7960817eb24b9c8e5dde320e6f26786b651e8504 | 549 | py | Python | setup.py | Rylan-L/AxonImaging | 412bac9ff343edc85d8dde2d39ea5f06ebed4fd5 | [
"MIT"
] | null | null | null | setup.py | Rylan-L/AxonImaging | 412bac9ff343edc85d8dde2d39ea5f06ebed4fd5 | [
"MIT"
] | null | null | null | setup.py | Rylan-L/AxonImaging | 412bac9ff343edc85d8dde2d39ea5f06ebed4fd5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 08 17:25:19 2018
@author: rylanl
"""
from distutils.core import setup
setup(
name='axonimaging',
version='0.1.0',
author='Rylan Larsen',
author_email='RylanL@alleninstitute.org',
packages=['AxonImaging'],
url='https://github.com/Rylan-L/AxonImagi... | 22.875 | 87 | 0.648452 |
7960818b18adf0f25eabe842770bdf35f8fa6144 | 109,360 | py | Python | .v/lib/python3.6/site-packages/ansible/modules/cloud/ovirt/ovirt_vm.py | binRick/ansible-callback-concise | fd7b05596b30872af3f79a32f223a0458bffbedd | [
"MIT"
] | 1 | 2020-03-22T01:04:39.000Z | 2020-03-22T01:04:39.000Z | .v/lib/python3.6/site-packages/ansible/modules/cloud/ovirt/ovirt_vm.py | binRick/ansible-callback-concise | fd7b05596b30872af3f79a32f223a0458bffbedd | [
"MIT"
] | null | null | null | .v/lib/python3.6/site-packages/ansible/modules/cloud/ovirt/ovirt_vm.py | binRick/ansible-callback-concise | fd7b05596b30872af3f79a32f223a0458bffbedd | [
"MIT"
] | 1 | 2020-03-22T01:04:48.000Z | 2020-03-22T01:04:48.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCU... | 43.225296 | 158 | 0.582324 |
7960819d8e29deff627a55f4b614482636ac2ddb | 3,257 | py | Python | tworaven_apps/ta2_interfaces/req_stream_produce_solution.py | TwoRavens/TwoRavens | e5f820557d6646df525ceed15e17d79f4159cf0a | [
"Apache-2.0"
] | 20 | 2017-12-11T07:26:06.000Z | 2021-11-22T16:16:20.000Z | tworaven_apps/ta2_interfaces/req_stream_produce_solution.py | TwoRavens/TwoRavens | e5f820557d6646df525ceed15e17d79f4159cf0a | [
"Apache-2.0"
] | 849 | 2017-10-20T18:21:18.000Z | 2022-02-18T02:45:44.000Z | tworaven_apps/ta2_interfaces/req_stream_produce_solution.py | TwoRavens/TwoRavens | e5f820557d6646df525ceed15e17d79f4159cf0a | [
"Apache-2.0"
] | 1 | 2020-05-18T06:02:13.000Z | 2020-05-18T06:02:13.000Z | """
send a gRPC GetSearchSolutionsResults command
capture the streaming results in the db as StoredResponse objects
"""
from django.conf import settings
from tworaven_apps.utils.basic_response import (ok_resp, err_resp)
from tworaven_apps.utils.json_helper import json_loads
from tworaven_apps.ta2_interfaces.ta2_util i... | 36.595506 | 84 | 0.625115 |
796082ac9429a8bf218afaa87c0c383be6d07e32 | 1,317 | py | Python | examples/beam/beam_7_.py | Bartman00/nusa | 472180c350d8940bf025f54b5b362e6dab280417 | [
"MIT"
] | null | null | null | examples/beam/beam_7_.py | Bartman00/nusa | 472180c350d8940bf025f54b5b362e6dab280417 | [
"MIT"
] | null | null | null | examples/beam/beam_7_.py | Bartman00/nusa | 472180c350d8940bf025f54b5b362e6dab280417 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# ***********************************
# Author: Pedro Jorge De Los Santos
# E-mail: delossantosmfq@gmail.com
# Web: labdls.blogspot.mx
# License: MIT License
# ***********************************
import numpy as np
from nusa import *
import itertools
import matplotlib.pyplot as plt
de... | 18.814286 | 50 | 0.558087 |
796082f86cbc2b99b0dbbcc476d0ab1321fa665c | 2,344 | py | Python | examples/gaussian/functions/model.py | wjlei1990/nnodes | f305ca59b914427693f4a0420c1656cf2da3f0c6 | [
"MIT"
] | 2 | 2022-03-01T18:19:30.000Z | 2022-03-18T12:19:39.000Z | examples/gaussian/functions/model.py | wjlei1990/nnodes | f305ca59b914427693f4a0420c1656cf2da3f0c6 | [
"MIT"
] | 9 | 2022-03-01T21:08:38.000Z | 2022-03-22T17:27:36.000Z | examples/gaussian/functions/model.py | wjlei1990/nnodes | f305ca59b914427693f4a0420c1656cf2da3f0c6 | [
"MIT"
] | 1 | 2022-03-09T23:18:10.000Z | 2022-03-09T23:18:10.000Z | import os
import numpy as np
def write_model(m, outdir, it, ls=None):
"""Takes in model vector, modldirectory, iteration and linesearch number
and write model to modl directory.
Parameters
----------
m : ndarray
modelvector
modldir : str
model directory
it : int
it... | 21.906542 | 76 | 0.625853 |
796082fd0f3fa15255f98b2574aabc9d84f3847f | 1,701 | py | Python | app/core/migrations/0001_initial.py | aviad-ariel/Recipe-api | d738c925d3d1edc07ea10991ac7f47e4733a0736 | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | aviad-ariel/Recipe-api | d738c925d3d1edc07ea10991ac7f47e4733a0736 | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | aviad-ariel/Recipe-api | d738c925d3d1edc07ea10991ac7f47e4733a0736 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.3 on 2020-02-05 13:15
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='User',
f... | 50.029412 | 266 | 0.637272 |
79608402b6926d9286d19f35ed6c4cbf1791d1ee | 31,335 | py | Python | flow/envs/base.py | Bobobert/aflow | 7d28e362f757397c0c5303bc495b10ed597e03d5 | [
"MIT"
] | null | null | null | flow/envs/base.py | Bobobert/aflow | 7d28e362f757397c0c5303bc495b10ed597e03d5 | [
"MIT"
] | null | null | null | flow/envs/base.py | Bobobert/aflow | 7d28e362f757397c0c5303bc495b10ed597e03d5 | [
"MIT"
] | null | null | null | """Base environment class. This is the parent of all other environments."""
from abc import ABCMeta, abstractmethod
from copy import deepcopy
import os
import atexit
import time
import traceback
import numpy as np
import random
import shutil
import subprocess
from flow.renderer.pyglet_renderer import PygletRenderer as... | 38.828996 | 117 | 0.595468 |
796085051ca694d7a3845df3d50b990792ce1875 | 1,901 | py | Python | python_spider/python_spider_tieba/tieba_img.py | GlacierBo/python_learn | f604029a1ec449d8d24bb5d40215f25df2a2b027 | [
"MIT"
] | 1 | 2018-02-12T04:56:08.000Z | 2018-02-12T04:56:08.000Z | python_spider/python_spider_tieba/tieba_img.py | GlacierBo/python_learn | f604029a1ec449d8d24bb5d40215f25df2a2b027 | [
"MIT"
] | null | null | null | python_spider/python_spider_tieba/tieba_img.py | GlacierBo/python_learn | f604029a1ec449d8d24bb5d40215f25df2a2b027 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: tieba_img
Description :
Author : Glacier
date:
-------------------------------------------------
Change Activity:
:
-------------------------------------------------
"""
__autho... | 24.688312 | 99 | 0.53919 |
796085a3397e3d1630ea69d814c91eb0dc0be44c | 853 | py | Python | has-a-relation.py | krishna438/python_concepts | ee8f0c7b8a5eab1a9c0cc8306a449e83661c9d77 | [
"MIT"
] | 1 | 2017-06-22T04:35:20.000Z | 2017-06-22T04:35:20.000Z | has-a-relation.py | krishna438/python_concepts | ee8f0c7b8a5eab1a9c0cc8306a449e83661c9d77 | [
"MIT"
] | null | null | null | has-a-relation.py | krishna438/python_concepts | ee8f0c7b8a5eab1a9c0cc8306a449e83661c9d77 | [
"MIT"
] | 2 | 2017-05-23T05:11:43.000Z | 2017-06-22T04:35:26.000Z | # In Object Oriented Approach, it is possible to have relationships between classes.
# When an object of a class becomes the instance variable of another class, it is known as "has-a" relationship or AGGREGATION.
# If ClassA 'has-a' ClassB, then ClassB aggregates ClassA
class Employee:
def __init__(self,name,emp_i... | 35.541667 | 127 | 0.749121 |
796087049267da1dcaeefb1ef0605d9022da66d1 | 657 | py | Python | var/spack/repos/builtin/packages/py-xpyb/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 9 | 2018-04-18T07:51:40.000Z | 2021-09-10T03:56:57.000Z | var/spack/repos/builtin/packages/py-xpyb/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 907 | 2018-04-18T11:17:57.000Z | 2022-03-31T13:20:25.000Z | var/spack/repos/builtin/packages/py-xpyb/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 29 | 2018-11-05T16:14:23.000Z | 2022-02-03T16:07:09.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyXpyb(AutotoolsPackage):
"""xpyb provides a Python binding to the X Window System protoco... | 28.565217 | 95 | 0.713851 |
796088352922eda3caddaaccb3bad3a055225bbe | 3,527 | py | Python | nicos_mlz/jcns/devices/fpga_new.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | nicos_mlz/jcns/devices/fpga_new.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | nicos_mlz/jcns/devices/fpga_new.py | jkrueger1/nicos | 5f4ce66c312dedd78995f9d91e8a6e3c891b262b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | # -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2022 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the te... | 37.924731 | 79 | 0.602779 |
796088d00c5cd14cec4da7712bfb0482ea6565c3 | 274,123 | py | Python | include/ClientGUIScrolledPanelsManagement.py | antonpaquin/hydrus | 33eae1c0566cfc528cedca84b606335531968ee3 | [
"WTFPL"
] | null | null | null | include/ClientGUIScrolledPanelsManagement.py | antonpaquin/hydrus | 33eae1c0566cfc528cedca84b606335531968ee3 | [
"WTFPL"
] | null | null | null | include/ClientGUIScrolledPanelsManagement.py | antonpaquin/hydrus | 33eae1c0566cfc528cedca84b606335531968ee3 | [
"WTFPL"
] | null | null | null | import ClientCaches
import ClientConstants as CC
import ClientData
import ClientDefaults
import ClientDownloading
import ClientGUIACDropdown
import ClientGUICommon
import ClientGUIControls
import ClientGUIDialogs
import ClientGUIListBoxes
import ClientGUIListCtrl
import ClientGUIPredicates
import ClientGUIScrolledPanel... | 43.573836 | 536 | 0.538193 |
79608a19e9f69b61b85a6d4df98e678a7cc4c056 | 1,665 | py | Python | Source/chrome/tools/perf/benchmarks/task_execution_time.py | yury-s/v8-inspector | 0ab4779e0909d387f243f41ca2621237cdb0c7fe | [
"BSD-3-Clause"
] | 20 | 2015-08-26T06:46:00.000Z | 2019-02-27T09:05:58.000Z | Source/chrome/tools/perf/benchmarks/task_execution_time.py | yury-s/v8-inspector | 0ab4779e0909d387f243f41ca2621237cdb0c7fe | [
"BSD-3-Clause"
] | null | null | null | Source/chrome/tools/perf/benchmarks/task_execution_time.py | yury-s/v8-inspector | 0ab4779e0909d387f243f41ca2621237cdb0c7fe | [
"BSD-3-Clause"
] | 2 | 2015-08-26T05:49:35.000Z | 2020-02-03T20:22:43.000Z | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from core import perf_benchmark
from measurements import task_execution_time
from telemetry import benchmark
import page_sets
@benchmark.Enabled('android'... | 28.706897 | 79 | 0.81021 |
79608ac37a73dbf73bdd5904f8c7a05b9daf9d50 | 50,482 | py | Python | src/transformers/models/layoutxlm/tokenization_layoutxlm.py | bhavika/transformers | 65cf33e7e53cd46313f3655f274b3f6ca0fd679d | [
"Apache-2.0"
] | 31 | 2022-02-02T13:13:41.000Z | 2022-03-29T08:37:20.000Z | src/transformers/models/layoutxlm/tokenization_layoutxlm.py | bhavika/transformers | 65cf33e7e53cd46313f3655f274b3f6ca0fd679d | [
"Apache-2.0"
] | 2 | 2022-03-14T10:13:16.000Z | 2022-03-14T11:50:27.000Z | src/transformers/models/layoutxlm/tokenization_layoutxlm.py | bhavika/transformers | 65cf33e7e53cd46313f3655f274b3f6ca0fd679d | [
"Apache-2.0"
] | 2 | 2022-03-21T04:32:39.000Z | 2022-03-22T01:02:49.000Z | # coding=utf-8
# Copyright 2021 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 46.96 | 124 | 0.616715 |
79608b11c583566e8a1e042e8d780b29dd6de1ef | 10,072 | py | Python | sharpy/managers/unit_role_manager.py | eladyaniv01/sharpy-sc2 | 91119cc3e3fce683c2dbe9687c616c9cc0461b06 | [
"MIT"
] | null | null | null | sharpy/managers/unit_role_manager.py | eladyaniv01/sharpy-sc2 | 91119cc3e3fce683c2dbe9687c616c9cc0461b06 | [
"MIT"
] | null | null | null | sharpy/managers/unit_role_manager.py | eladyaniv01/sharpy-sc2 | 91119cc3e3fce683c2dbe9687c616c9cc0461b06 | [
"MIT"
] | null | null | null | from typing import List, Union, Set, Iterable
from sharpy.managers.manager_base import ManagerBase
from sc2 import UnitTypeId, Race
from sc2.client import Client
from sc2.position import Point2
from sc2.unit import Unit
from sc2.units import Units
from sharpy.general.extended_power import ExtendedPower
from sharpy.ma... | 43.042735 | 130 | 0.663523 |
79608b2077bb4eb2b8034c3cae34b03876544cbd | 768 | py | Python | Day4/z-score-for-fun/z-score.py | rameshbalan/pythoncourse.github.io | 1def1b85ddff7f0f09a3efdb919135c5686658d7 | [
"MIT"
] | null | null | null | Day4/z-score-for-fun/z-score.py | rameshbalan/pythoncourse.github.io | 1def1b85ddff7f0f09a3efdb919135c5686658d7 | [
"MIT"
] | null | null | null | Day4/z-score-for-fun/z-score.py | rameshbalan/pythoncourse.github.io | 1def1b85ddff7f0f09a3efdb919135c5686658d7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Importing pandas library
import pandas as pd
# Getting the file from the user
file = input("Enter your csv file name:\n")
# Reading the file from the user and saving it as data frame in 'df'
df = pd.read_csv(file)
# Getiing the list of columns form the data frame
cols = list(df.columns)
# Remov... | 26.482759 | 96 | 0.727865 |
79608b8b5aa0aa04f552f7ff02e937563b9df76a | 193 | py | Python | Ex014.py | CarlosDouradoPGR/EstruturaDeRepet | f9127bfeca439fe68a79e5a63dc66f55587f2c80 | [
"MIT"
] | null | null | null | Ex014.py | CarlosDouradoPGR/EstruturaDeRepet | f9127bfeca439fe68a79e5a63dc66f55587f2c80 | [
"MIT"
] | null | null | null | Ex014.py | CarlosDouradoPGR/EstruturaDeRepet | f9127bfeca439fe68a79e5a63dc66f55587f2c80 | [
"MIT"
] | null | null | null | par = 0
impa = 0
for c in range(1,11):
numb = int(input(f'Digite o {c}º número: '))
if numb % 2 == 0:
par += 1
elif numb % 2 != 0:
impa += 1
print(impa)
print(par)
| 16.083333 | 48 | 0.492228 |
79608bfc1c5c1a397a1b4ab68ec850c854fc4d3b | 15,402 | py | Python | pytorch_lightning/core/saving.py | Tshimanga/pytorch-lightning | ff7305f74d4e097a45b6a4d8c0fff6d4f5aaa386 | [
"Apache-2.0"
] | 1 | 2021-04-16T12:37:20.000Z | 2021-04-16T12:37:20.000Z | pytorch_lightning/core/saving.py | Tshimanga/pytorch-lightning | ff7305f74d4e097a45b6a4d8c0fff6d4f5aaa386 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/core/saving.py | Tshimanga/pytorch-lightning | ff7305f74d4e097a45b6a4d8c0fff6d4f5aaa386 | [
"Apache-2.0"
] | 2 | 2021-06-10T21:46:37.000Z | 2021-08-24T18:49:17.000Z | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 38.123762 | 116 | 0.642189 |
79608c8ea4510ca03220a106bf9bce91342c4ad4 | 81,145 | py | Python | txdav/caldav/datastore/test/test_sql_sharing.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | 1 | 2017-02-18T19:22:19.000Z | 2017-02-18T19:22:19.000Z | txdav/caldav/datastore/test/test_sql_sharing.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | txdav/caldav/datastore/test/test_sql_sharing.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | ##
# Copyright (c) 2005-2015 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 42.484293 | 149 | 0.676949 |
79608ef56f9a650f27edcbb84bf574a79fdbaf6e | 4,755 | py | Python | macro_benchmark/BERT_Tensorflow/process_results.py | songhappy/ai-matrix | 901078e480c094235c721c49f8141aec7a84e70e | [
"Apache-2.0"
] | 180 | 2018-09-20T07:27:40.000Z | 2022-03-19T07:55:42.000Z | macro_benchmark/BERT_Tensorflow/process_results.py | songhappy/ai-matrix | 901078e480c094235c721c49f8141aec7a84e70e | [
"Apache-2.0"
] | 80 | 2018-09-26T18:55:56.000Z | 2022-02-10T02:03:26.000Z | macro_benchmark/BERT_Tensorflow/process_results.py | songhappy/ai-matrix | 901078e480c094235c721c49f8141aec7a84e70e | [
"Apache-2.0"
] | 72 | 2018-08-30T00:49:15.000Z | 2022-02-15T23:22:40.000Z | import numpy as np
import os
import argparse
def is_number(s):
try:
float(s)
return True
except ValueError:
return False
def process_infer():
table0 = []
table0.append(['System performance, unit is sentences/second'])
table0.append(['System performance measures the performa... | 38.346774 | 160 | 0.564458 |
79608f2b02a43556138f667d1aa0ea65a6507ad3 | 1,307 | py | Python | databroker/__init__.py | jklynch/databroker | 9d228396c7759cf9b1463b7f87647f29f5efb357 | [
"BSD-3-Clause"
] | null | null | null | databroker/__init__.py | jklynch/databroker | 9d228396c7759cf9b1463b7f87647f29f5efb357 | [
"BSD-3-Clause"
] | null | null | null | databroker/__init__.py | jklynch/databroker | 9d228396c7759cf9b1463b7f87647f29f5efb357 | [
"BSD-3-Clause"
] | null | null | null | # Import intake to run driver discovery first and avoid circular import issues.
import logging
import intake # noqa: F401
from intake.catalog.default import load_combo_catalog
from .v1 import Broker, Header, ALL, temp, temp_config # noqa: F401
from .utils import ( # noqa: 401
lookup_config, list_configs, descr... | 29.704545 | 79 | 0.710788 |
79608f4fb3cde38998dcc663a03b9560b9b5f819 | 14,163 | py | Python | pandas/tests/scalar/test_nat.py | sofiane87/pandas | 0de99558b497c5611cbe5d35d504763bd7692275 | [
"BSD-3-Clause"
] | 2 | 2019-11-13T18:20:29.000Z | 2020-04-18T02:58:39.000Z | pandas/tests/scalar/test_nat.py | sofiane87/pandas | 0de99558b497c5611cbe5d35d504763bd7692275 | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/scalar/test_nat.py | sofiane87/pandas | 0de99558b497c5611cbe5d35d504763bd7692275 | [
"BSD-3-Clause"
] | 2 | 2019-12-21T21:17:43.000Z | 2019-12-26T10:34:36.000Z | from datetime import datetime, timedelta
import operator
import numpy as np
import pytest
import pytz
from pandas._libs.tslibs import iNaT
import pandas.compat as compat
from pandas.core.dtypes.common import is_datetime64_any_dtype
from pandas import (
DatetimeIndex,
Index,
NaT,
Period,
Series,
... | 28.213147 | 88 | 0.588858 |
79609055351b44317ef1226b3dc10bd5fdc4832f | 3,389 | py | Python | tests/test_entities.py | ryanmellish/hacs-hubitat | 44275e1256fa05ecf979ef38e803a6a34c64094a | [
"MIT"
] | null | null | null | tests/test_entities.py | ryanmellish/hacs-hubitat | 44275e1256fa05ecf979ef38e803a6a34c64094a | [
"MIT"
] | null | null | null | tests/test_entities.py | ryanmellish/hacs-hubitat | 44275e1256fa05ecf979ef38e803a6a34c64094a | [
"MIT"
] | null | null | null | from asyncio import Future
from typing import Awaitable
from custom_components.hubitat.device import Hub
from hubitatmaker import Device
from pytest_homeassistant_custom_component.async_mock import (
Mock,
NonCallableMock,
call,
patch,
)
from homeassistant.config_entries import ConfigEntry
from homeas... | 33.554455 | 84 | 0.744467 |
796091c6fe6c1b9fd5ed38ad10c344ff05ff8d18 | 2,360 | py | Python | test-framework/test-suites/integration/tests/list/test_list_host.py | knutsonchris/stacki | 33087dd5fa311984a66ccecfeee6f9c2c25f665d | [
"BSD-3-Clause"
] | null | null | null | test-framework/test-suites/integration/tests/list/test_list_host.py | knutsonchris/stacki | 33087dd5fa311984a66ccecfeee6f9c2c25f665d | [
"BSD-3-Clause"
] | null | null | null | test-framework/test-suites/integration/tests/list/test_list_host.py | knutsonchris/stacki | 33087dd5fa311984a66ccecfeee6f9c2c25f665d | [
"BSD-3-Clause"
] | null | null | null | import json
class TestListHost:
def test_lookup_by_IP(self, host, add_host_with_interface, host_os):
# Set an IP on the interface
result = host.run('stack set host interface ip backend-0-0 interface=eth0 ip=192.168.1.1')
assert result.rc == 0
# List our host by IP
result = host.run(f'stack list host 192.1... | 30.649351 | 95 | 0.668644 |
796093989629c4276d5a6b45ccc6fba6a9345bd0 | 886 | py | Python | aiotdlib/api/functions/request_password_recovery.py | jraylan/aiotdlib | 4528fcfca7c5c69b54a878ce6ce60e934a2dcc73 | [
"MIT"
] | 37 | 2021-05-04T10:41:41.000Z | 2022-03-30T13:48:05.000Z | aiotdlib/api/functions/request_password_recovery.py | jraylan/aiotdlib | 4528fcfca7c5c69b54a878ce6ce60e934a2dcc73 | [
"MIT"
] | 13 | 2021-07-17T19:54:51.000Z | 2022-02-26T06:50:00.000Z | aiotdlib/api/functions/request_password_recovery.py | jraylan/aiotdlib | 4528fcfca7c5c69b54a878ce6ce60e934a2dcc73 | [
"MIT"
] | 7 | 2021-09-22T21:27:11.000Z | 2022-02-20T02:33:19.000Z | # =============================================================================== #
# #
# This file has been generated automatically!! Do not change this manually! #
# ... | 36.916667 | 112 | 0.452596 |
796093b28e5a4d06dd9904038bf89b99111d18a6 | 3,401 | py | Python | Smsproj/Smsproj/settings.py | Prakhar-100/DjangoProject | 5030fabe038bd67af50364431705837aa0bde91b | [
"MIT"
] | null | null | null | Smsproj/Smsproj/settings.py | Prakhar-100/DjangoProject | 5030fabe038bd67af50364431705837aa0bde91b | [
"MIT"
] | null | null | null | Smsproj/Smsproj/settings.py | Prakhar-100/DjangoProject | 5030fabe038bd67af50364431705837aa0bde91b | [
"MIT"
] | null | null | null | """
Django settings for Smsproj project.
Generated by 'django-admin startproject' using Django 3.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from pathlib... | 26.161538 | 91 | 0.695678 |
79609454d3bbf65ab101a5aaa8f04e6f48cd7863 | 5,878 | py | Python | kfac/kfac_preconditioner_inv_dp.py | lzhangbv/kfac_pytorch | 159e7ef9541bb960d79c438622780cdcc71b3210 | [
"MIT"
] | null | null | null | kfac/kfac_preconditioner_inv_dp.py | lzhangbv/kfac_pytorch | 159e7ef9541bb960d79c438622780cdcc71b3210 | [
"MIT"
] | null | null | null | kfac/kfac_preconditioner_inv_dp.py | lzhangbv/kfac_pytorch | 159e7ef9541bb960d79c438622780cdcc71b3210 | [
"MIT"
] | null | null | null | import math
import torch
import torch.optim as optim
import numpy as np
#import horovod.torch as hvd
import kfac.backend as backend # hvd -> backend.comm
from kfac.utils import (ComputeA, ComputeG)
from kfac.utils import update_running_avg
from kfac.utils import mat_inv
from kfac.kfac_preconditioner_inv import KFAC a... | 45.215385 | 117 | 0.599524 |
79609530df9220fc2e06a939579dc0caba3ac1c6 | 54,403 | py | Python | flair/data.py | piamarlene/flair | 4f72d538fa49649aac88c7b5130250180ba64e43 | [
"MIT"
] | null | null | null | flair/data.py | piamarlene/flair | 4f72d538fa49649aac88c7b5130250180ba64e43 | [
"MIT"
] | null | null | null | flair/data.py | piamarlene/flair | 4f72d538fa49649aac88c7b5130250180ba64e43 | [
"MIT"
] | null | null | null | import logging
import re
import typing
from abc import ABC, abstractmethod
from collections import Counter, defaultdict
from functools import lru_cache
from operator import itemgetter
from pathlib import Path
from typing import Callable, Dict, List, Optional, Union, cast
import torch
from deprecated import deprecated
... | 34.345328 | 137 | 0.606933 |
796095ab8e6fa9244aac642fe581048606c60455 | 133 | py | Python | Python/overload-coverage/test_example.py | MartinThoma/algorithms | 4347a9b7bf54ef378d16d26ef9e357ddc710664b | [
"MIT"
] | 209 | 2015-01-02T03:47:12.000Z | 2022-03-06T16:54:47.000Z | Python/overload-coverage/test_example.py | Kerwin-Xie/algorithms | 4347a9b7bf54ef378d16d26ef9e357ddc710664b | [
"MIT"
] | 3 | 2015-12-06T14:40:34.000Z | 2021-03-22T17:40:24.000Z | Python/overload-coverage/test_example.py | Kerwin-Xie/algorithms | 4347a9b7bf54ef378d16d26ef9e357ddc710664b | [
"MIT"
] | 114 | 2015-01-31T08:37:10.000Z | 2022-02-23T04:42:28.000Z | from example import foo
def test_foo():
assert foo(a=None) is None
assert foo(False) is True
assert foo(True) is False
| 16.625 | 30 | 0.684211 |
796096166472d67c9ccb86ca05c11122b816563b | 3,950 | py | Python | tkitLoss/mish.py | napoler/pytorch-loss | 36a599d868844491633f3e0091f73759922a4557 | [
"MIT"
] | null | null | null | tkitLoss/mish.py | napoler/pytorch-loss | 36a599d868844491633f3e0091f73759922a4557 | [
"MIT"
] | null | null | null | tkitLoss/mish.py | napoler/pytorch-loss | 36a599d868844491633f3e0091f73759922a4557 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- encoding: utf-8 -*-
import torch
import torch.cuda.amp as amp
import torch.nn as nn
import torch.nn.functional as F
##
# version 1: use pytorch autograd
class MishV1(nn.Module):
def __init__(self):
super(MishV1, self).__init__()
def forward(self, feat):
return feat ... | 27.054795 | 105 | 0.573165 |
7960965a246c27a5b571b5885aaf41573fbe0528 | 1,126 | py | Python | html_to_markdown_cli/html_to_markdown_cli/utils/writer.py | bossjones/sandbox | 9ae6a01576d42ff2616f38bad0df2c6d73afe91f | [
"MIT"
] | 4 | 2022-02-23T11:03:32.000Z | 2022-03-07T20:01:42.000Z | html_to_markdown_cli/html_to_markdown_cli/utils/writer.py | bossjones/sandbox | 9ae6a01576d42ff2616f38bad0df2c6d73afe91f | [
"MIT"
] | null | null | null | html_to_markdown_cli/html_to_markdown_cli/utils/writer.py | bossjones/sandbox | 9ae6a01576d42ff2616f38bad0df2c6d73afe91f | [
"MIT"
] | 1 | 2022-02-23T11:03:32.000Z | 2022-02-23T11:03:32.000Z | """Write to disk asynchronously."""
# https://github.com/hackersandslackers/asyncio-tutorial/blob/0f4c99776b61ca3eafd850c43202bc7c52349552/asyncio_tutorial/part_II_aiohttp_aiofiles/writer.py
import aiofiles
import logging
from html_to_markdown_cli.dbx_logger import ( # noqa: E402
get_logger,
)
LOGGER = get_logger... | 40.214286 | 154 | 0.70071 |
796096c1c50893d696b4438b3858d3367239caf3 | 4,064 | py | Python | dashboard/dashboard/pages/__init__.py | uk-gov-mirror/NHSX.covid-chest-imaging-database | 77799a97193d09e9267182d18fbb79d604bbb038 | [
"MIT"
] | 56 | 2020-04-08T12:40:28.000Z | 2021-10-02T22:57:16.000Z | dashboard/dashboard/pages/__init__.py | uk-gov-mirror/NHSX.covid-chest-imaging-database | 77799a97193d09e9267182d18fbb79d604bbb038 | [
"MIT"
] | 111 | 2020-04-02T13:23:06.000Z | 2022-03-30T13:23:28.000Z | dashboard/dashboard/pages/__init__.py | uk-gov-mirror/NHSX.covid-chest-imaging-database | 77799a97193d09e9267182d18fbb79d604bbb038 | [
"MIT"
] | 10 | 2020-05-05T14:07:11.000Z | 2022-01-11T15:47:27.000Z | """Create and manage all the pages in the dashboard
"""
from pathlib import Path
import dash_bootstrap_components as dbc
import plotly.io as pio
from jinja2 import Environment, FileSystemLoader
from dataset import Dataset
from .hospitals import create_app as hospitals_create_app
from .images import create_app as i... | 30.103704 | 84 | 0.649852 |
796096dfa6b1816bd86a1cd6b0d432699225a7bf | 3,058 | py | Python | accounts/views.py | zubev/my_cars | 31e058d5b8de0c876b6384003b6115584ed9bd7f | [
"MIT"
] | null | null | null | accounts/views.py | zubev/my_cars | 31e058d5b8de0c876b6384003b6115584ed9bd7f | [
"MIT"
] | null | null | null | accounts/views.py | zubev/my_cars | 31e058d5b8de0c876b6384003b6115584ed9bd7f | [
"MIT"
] | null | null | null | from django.contrib.auth import logout, login, authenticate
from django.contrib.auth.decorators import login_required
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.models import User
from django.db import transaction
from django... | 29.403846 | 69 | 0.635056 |
7960971975c9f7fbecaafa6828e498a0e809a367 | 8,415 | py | Python | Madgwick_AHRS_Test.py | matreshka15/raspberry-pi-USV-program | b93e586b19967f3acb5baa741d9f8426a1ab0b9f | [
"Apache-2.0"
] | 12 | 2020-12-05T04:36:18.000Z | 2022-02-13T03:24:45.000Z | Madgwick_AHRS_Test.py | matreshka15/raspberry-pi-USV-program | b93e586b19967f3acb5baa741d9f8426a1ab0b9f | [
"Apache-2.0"
] | null | null | null | Madgwick_AHRS_Test.py | matreshka15/raspberry-pi-USV-program | b93e586b19967f3acb5baa741d9f8426a1ab0b9f | [
"Apache-2.0"
] | 4 | 2020-11-16T07:55:53.000Z | 2021-07-26T04:45:12.000Z | '''Copyright 2019 Eastar Tech 李东豫<8523429@qq.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 by applicable law or... | 34.487705 | 150 | 0.535829 |
796097538e37a8a2bf159a4c9390d86961899a0a | 42 | py | Python | nilmtk/version.py | oafolabi/nilmtk | dc4675d124693796a5567ce238cb62ead66dfc7a | [
"Apache-2.0"
] | 3 | 2018-11-09T16:13:32.000Z | 2019-11-10T20:10:10.000Z | nilmtk/version.py | oafolabi/nilmtk | dc4675d124693796a5567ce238cb62ead66dfc7a | [
"Apache-2.0"
] | null | null | null | nilmtk/version.py | oafolabi/nilmtk | dc4675d124693796a5567ce238cb62ead66dfc7a | [
"Apache-2.0"
] | 1 | 2018-10-24T10:28:52.000Z | 2018-10-24T10:28:52.000Z | version = '0.2.1'
short_version = '0.2.1'
| 14 | 23 | 0.619048 |
79609756ea2dc697ebb6b42e421eca8df85fc06e | 1,036 | py | Python | app/core/tests/test_commands.py | nniklevi/recipe-app-api | f29f965f9864a19b378ca7d33e2d96080764e1cc | [
"MIT"
] | null | null | null | app/core/tests/test_commands.py | nniklevi/recipe-app-api | f29f965f9864a19b378ca7d33e2d96080764e1cc | [
"MIT"
] | null | null | null | app/core/tests/test_commands.py | nniklevi/recipe-app-api | f29f965f9864a19b378ca7d33e2d96080764e1cc | [
"MIT"
] | null | null | null | from unittest.mock import patch
from django.core.management import call_command
from django.db.utils import OperationalError
from django.test import TestCase
class CommandTest(TestCase):
"""test commands done in command line
Args:
TestCase ([type]): [base Django test class]
"""
def test_wai... | 34.533333 | 77 | 0.676641 |
796097b82779889016ef66c4b23cc915a91309eb | 132 | py | Python | tensornet/data/datasets/__init__.py | Pandinosaurus/Depth-Estimation-Segmentation | 2eea883c96bf106774ea94464fc16c6baea86a95 | [
"MIT"
] | 4 | 2020-06-18T13:07:19.000Z | 2022-01-07T10:51:10.000Z | tensornet/data/datasets/__init__.py | Pandinosaurus/Depth-Estimation-Segmentation | 2eea883c96bf106774ea94464fc16c6baea86a95 | [
"MIT"
] | 1 | 2021-07-31T04:34:46.000Z | 2021-08-11T05:55:57.000Z | tensornet/data/datasets/__init__.py | Pandinosaurus/Depth-Estimation-Segmentation | 2eea883c96bf106774ea94464fc16c6baea86a95 | [
"MIT"
] | 2 | 2020-07-21T18:41:58.000Z | 2021-05-28T09:40:02.000Z | from .mnist import MNIST
from .cifar10 import CIFAR10
from .tinyimagenet import TinyImageNet
from .modest_museum import MODESTMuseum | 33 | 39 | 0.856061 |
796097c69a5aab4b4c9f727a60a1e0ff58bd223b | 1,215 | py | Python | app/docs.py | AutomationPanda/device-registry | b4e444e2911eafa25ce937038aa9f9886dc6adc5 | [
"MIT"
] | 5 | 2021-09-06T23:10:02.000Z | 2021-09-07T19:46:03.000Z | app/docs.py | AutomationPanda/device-registry | b4e444e2911eafa25ce937038aa9f9886dc6adc5 | [
"MIT"
] | null | null | null | app/docs.py | AutomationPanda/device-registry | b4e444e2911eafa25ce937038aa9f9886dc6adc5 | [
"MIT"
] | null | null | null | """
This module provides documentation using `flask-autodoc`.
"""
# --------------------------------------------------------------------------------
# Imports
# --------------------------------------------------------------------------------
from flask import Blueprint, jsonify
from flask_selfdoc import Autodoc
# -... | 26.413043 | 82 | 0.409053 |
7960989e1796c08447b4d93b0ac349fdd398a7ac | 49,447 | py | Python | neotime/__init__.py | Pils19/neotime | e86027b97ade29a61a85bce63b8e749973c4ccb4 | [
"Apache-2.0"
] | null | null | null | neotime/__init__.py | Pils19/neotime | e86027b97ade29a61a85bce63b8e749973c4ccb4 | [
"Apache-2.0"
] | null | null | null | neotime/__init__.py | Pils19/neotime | e86027b97ade29a61a85bce63b8e749973c4ccb4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# Copyright 2018, Nigel Small & Neo4j Sweden AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | 33.185906 | 135 | 0.593868 |
796098a6936f42890b23512200e925b8215595f2 | 2,800 | py | Python | utils/logger.py | arghosh/noisy_label_pretrain | 5731ea2f3bf99391d68b5eb2f488897ce3b2fdfb | [
"MIT"
] | 24 | 2021-04-21T03:37:10.000Z | 2022-02-17T07:59:09.000Z | utils/logger.py | arghosh/noisy_label_pretrain | 5731ea2f3bf99391d68b5eb2f488897ce3b2fdfb | [
"MIT"
] | null | null | null | utils/logger.py | arghosh/noisy_label_pretrain | 5731ea2f3bf99391d68b5eb2f488897ce3b2fdfb | [
"MIT"
] | 11 | 2021-04-27T01:03:46.000Z | 2022-03-08T08:31:04.000Z | import os
import sys
import random
import numpy as np
from collections import OrderedDict
from tabulate import tabulate
from pandas import DataFrame
from time import gmtime, strftime
import time
class Logger:
def __init__(self, name='name', fmt=None, base='./logs'):
self.handler = True
self.scala... | 32.941176 | 110 | 0.553214 |
796099c11939fe0c1f1539d2f4f831ffcf3793ab | 14,262 | py | Python | code/training/idr_train.py | pengsongyou/idr | b496ea43b6a45e2a29408c89ec4cb63c0a379efa | [
"MIT"
] | null | null | null | code/training/idr_train.py | pengsongyou/idr | b496ea43b6a45e2a29408c89ec4cb63c0a379efa | [
"MIT"
] | null | null | null | code/training/idr_train.py | pengsongyou/idr | b496ea43b6a45e2a29408c89ec4cb63c0a379efa | [
"MIT"
] | null | null | null | import os
from datetime import datetime
from pyhocon import ConfigFactory
import sys
import torch
import utils.general as utils
import utils.plots as plt
from ipdb import set_trace as st
class IDRTrainRunner():
def __init__(self,**kwargs):
torch.set_default_dtype(torch.float32)
torch.set_num_threa... | 47.069307 | 132 | 0.576497 |
79609a8447ef9c897a0b3d7095cc2ea3f47f8eae | 2,430 | py | Python | IntroI/01_intro_collections.py | melissa-24/CSPT13_IntroPython_GP | 868e3e97cc55646adbc75c2291a676c70426436d | [
"MIT"
] | null | null | null | IntroI/01_intro_collections.py | melissa-24/CSPT13_IntroPython_GP | 868e3e97cc55646adbc75c2291a676c70426436d | [
"MIT"
] | null | null | null | IntroI/01_intro_collections.py | melissa-24/CSPT13_IntroPython_GP | 868e3e97cc55646adbc75c2291a676c70426436d | [
"MIT"
] | null | null | null |
# collections - aka arrays
# create an empty list? Array
# you can use either
melissa_list = []
# my_list2 = list()
print(melissa_list)
# create a list with numbers 1, 2, 3, 4, 5
numbers = [1, 2, 3, 4, 5]
print(numbers)
# add an element 24 to numbers
numbers.append(24)
print(numbers)
# add an element 12 to the st... | 21.696429 | 132 | 0.672016 |
79609aaf0ea43f83223faea51725bcc675a52662 | 9,193 | py | Python | bert/modeling_test.py | xptree/coref | 2249165a92a5c28e8f2385090d39dc0b0c5f3084 | [
"Apache-2.0"
] | null | null | null | bert/modeling_test.py | xptree/coref | 2249165a92a5c28e8f2385090d39dc0b0c5f3084 | [
"Apache-2.0"
] | null | null | null | bert/modeling_test.py | xptree/coref | 2249165a92a5c28e8f2385090d39dc0b0c5f3084 | [
"Apache-2.0"
] | null | null | null | # 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 ... | 33.068345 | 78 | 0.654846 |
79609aba34131b13d36d95b9c9aabc7984a4e804 | 2,377 | py | Python | anchore_engine/db/entities/exceptions.py | Nordix/anchore-engine | f25baa5cbf9aa34d56e56b341a90f577d85e6146 | [
"Apache-2.0"
] | null | null | null | anchore_engine/db/entities/exceptions.py | Nordix/anchore-engine | f25baa5cbf9aa34d56e56b341a90f577d85e6146 | [
"Apache-2.0"
] | 3 | 2021-07-15T19:58:01.000Z | 2021-09-16T09:39:46.000Z | anchore_engine/db/entities/exceptions.py | Nordix/anchore-engine | f25baa5cbf9aa34d56e56b341a90f577d85e6146 | [
"Apache-2.0"
] | null | null | null | """
Exception handling utilities and functions.
NOTE: these are PostgreSQL specific, so any dialect change will require updates here.
"""
from sqlalchemy.exc import ProgrammingError
try:
from anchore_engine.subsys import logger, identities
# Separate logger for use during bootstrap when logging may not be ... | 27.964706 | 216 | 0.684056 |
79609bb2deacb93260ec61dcebc79ee2241ff8e2 | 15,226 | py | Python | src/backend/common/manipulators/tests/base_manipulator_test.py | ZachOrr/the-blue-alliance | b9a2e6e07374fb12c70f8fae1948bfe90e34adfe | [
"MIT"
] | 266 | 2015-01-04T00:10:48.000Z | 2022-03-28T18:42:05.000Z | src/backend/common/manipulators/tests/base_manipulator_test.py | the-blue-alliance/the-blue-alliance | ba7a7f928f5c5119b51eb1c97811d437cea49a8c | [
"MIT"
] | 2,673 | 2015-01-01T20:14:33.000Z | 2022-03-31T18:17:16.000Z | src/backend/common/manipulators/tests/base_manipulator_test.py | ZachOrr/the-blue-alliance | b9a2e6e07374fb12c70f8fae1948bfe90e34adfe | [
"MIT"
] | 230 | 2015-01-04T00:10:48.000Z | 2022-03-26T18:12:04.000Z | import json
from typing import Dict, List, Optional, Set
import pytest
from google.appengine.ext import deferred
from google.appengine.ext import ndb
from pyre_extensions import none_throws
from backend.common.cache_clearing.get_affected_queries import TCacheKeyAndQuery
from backend.common.consts.api_version import A... | 29.680312 | 87 | 0.701563 |
79609bfe74f5af2c35cf744f9ea644a0bf2f97a8 | 1,364 | py | Python | scaffold/generators/common.py | CaravelKit/saas-base | bb3297cebc09ff8fb91f9976931694d0671538ca | [
"MIT"
] | 189 | 2019-01-30T02:13:36.000Z | 2022-03-20T03:48:51.000Z | scaffold/generators/common.py | CaravelKit/saas-template | bb3297cebc09ff8fb91f9976931694d0671538ca | [
"MIT"
] | 4 | 2020-10-11T17:21:26.000Z | 2022-02-12T03:01:43.000Z | scaffold/generators/common.py | CaravelKit/saas-template | bb3297cebc09ff8fb91f9976931694d0671538ca | [
"MIT"
] | 49 | 2019-02-26T15:27:32.000Z | 2022-03-11T23:05:11.000Z | # Functions used all the generators
import os
# Check if file and path exist, if not, create them. Then rewrite file or add content at the
# beginning, commenting the existing part.
def create_write_file(file_path, new_content, rewrite = False, comment_start = '<!--', comment_end = '-->',
ignore_existing_files =... | 35.894737 | 107 | 0.612903 |
79609ce2ba52953b5a289a909031fe80f7e92a8d | 1,044 | py | Python | fabrica/config.py | xyla-io/fabrica | 2a9f3c1920ed63636b17192613b8a5c51088e074 | [
"MIT"
] | null | null | null | fabrica/config.py | xyla-io/fabrica | 2a9f3c1920ed63636b17192613b8a5c51088e074 | [
"MIT"
] | null | null | null | fabrica/config.py | xyla-io/fabrica | 2a9f3c1920ed63636b17192613b8a5c51088e074 | [
"MIT"
] | null | null | null | import os
import json
from pathlib import Path
from typing import Dict
from data_layer import Redshift, Mongo
def get_config(name: str):
environment_key = f'FABRICA_{name.upper()}_CONFIG_PATH'
config_path = os.getenv(environment_key)
if config_path is None:
config_path = Path(__file__).parent.parent / 'conf... | 32.625 | 80 | 0.755747 |
79609daac1f896ae44d175bbb2bfc87659f77b6b | 4,719 | py | Python | tests/models/test_pool.py | emilioego/airflow | 3457c7847cd24413ff5b622e65c27d8370f94502 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 79 | 2021-10-15T07:32:27.000Z | 2022-03-28T04:10:19.000Z | tests/models/test_pool.py | emilioego/airflow | 3457c7847cd24413ff5b622e65c27d8370f94502 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 153 | 2021-10-15T05:23:46.000Z | 2022-02-23T06:07:10.000Z | tests/models/test_pool.py | emilioego/airflow | 3457c7847cd24413ff5b622e65c27d8370f94502 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 23 | 2021-10-15T02:36:37.000Z | 2022-03-17T02:59:27.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 36.022901 | 99 | 0.633397 |
79609deb55aee5b1170c602ab7b790a72e4eefd8 | 2,576 | py | Python | tridesclous/tests/test_matplotlibplot.py | remi-pr/tridesclous | 074f425fd40f1fb76f619f74cc024dd9817b7ee7 | [
"MIT"
] | 36 | 2016-01-27T22:27:12.000Z | 2022-01-28T08:49:27.000Z | tridesclous/tests/test_matplotlibplot.py | remi-pr/tridesclous | 074f425fd40f1fb76f619f74cc024dd9817b7ee7 | [
"MIT"
] | 87 | 2015-12-14T08:16:16.000Z | 2022-03-22T14:35:55.000Z | tridesclous/tests/test_matplotlibplot.py | remi-pr/tridesclous | 074f425fd40f1fb76f619f74cc024dd9817b7ee7 | [
"MIT"
] | 31 | 2015-11-10T14:37:28.000Z | 2022-03-30T06:41:19.000Z | import numpy as np
import matplotlib.pyplot as plt
from tridesclous import download_dataset
from tridesclous.dataio import DataIO
from tridesclous.catalogueconstructor import CatalogueConstructor
from tridesclous.matplotlibplot import *
import matplotlib.pyplot as plt
from tridesclous.tests.testingtools import setu... | 30.305882 | 100 | 0.760093 |
79609e0ba79ea7210e33ff1d38434f458acb1da7 | 1,028 | py | Python | LanguageConstructs/DataModel/References/main.py | ha-khan/PythonPractice | 31366d0a3380b168b96cf2e90cef3960efee8a7e | [
"MIT"
] | null | null | null | LanguageConstructs/DataModel/References/main.py | ha-khan/PythonPractice | 31366d0a3380b168b96cf2e90cef3960efee8a7e | [
"MIT"
] | null | null | null | LanguageConstructs/DataModel/References/main.py | ha-khan/PythonPractice | 31366d0a3380b168b96cf2e90cef3960efee8a7e | [
"MIT"
] | null | null | null |
# variable declaration at module level scope, global
state = 'NONE'
def modify_state():
global state
state = 'STARTING'
def main():
global state
modify_state()
print(state)
# "references" or alias for state
state_2 = state
# calls __eq__() .. compares value
assert state_2 == s... | 20.156863 | 67 | 0.643969 |
79609e240752d9153ed77293717b7d6be272b655 | 428 | py | Python | app.py | lucferbux/flask-server-template | becebb6a662c869b57cf8608754fc7248b35cd8f | [
"MIT"
] | null | null | null | app.py | lucferbux/flask-server-template | becebb6a662c869b57cf8608754fc7248b35cd8f | [
"MIT"
] | null | null | null | app.py | lucferbux/flask-server-template | becebb6a662c869b57cf8608754fc7248b35cd8f | [
"MIT"
] | null | null | null | import os
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config.from_object(os.environ['APP_SETTINGS'])
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db = SQLAlchemy(app)
from models import Result
@app.route('/')
def hello():
return "Hello World!"
@app.route('/... | 19.454545 | 52 | 0.719626 |
79609ffe1978df98ec0dbc7dd9a6d0caab4fb197 | 5,188 | py | Python | tests/core/data/utilities/test_classification.py | AjinkyaIndulkar/lightning-flash | e65020c7e5bd779d477a198865b0a84ac4f39720 | [
"Apache-2.0"
] | null | null | null | tests/core/data/utilities/test_classification.py | AjinkyaIndulkar/lightning-flash | e65020c7e5bd779d477a198865b0a84ac4f39720 | [
"Apache-2.0"
] | null | null | null | tests/core/data/utilities/test_classification.py | AjinkyaIndulkar/lightning-flash | e65020c7e5bd779d477a198865b0a84ac4f39720 | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 34.586667 | 116 | 0.580185 |
7960a07ddcda2c49c910d83f6faff17b55d7b068 | 6 | py | Python | tools/partition_make/common/build/lib/__init__.py | Stanley-Y/QuecOpen | 372403f19507a19d26750a5cec422b7ba31390e6 | [
"MIT"
] | 30 | 2019-05-08T17:07:10.000Z | 2022-03-22T05:46:42.000Z | tools/partition_make/common/build/lib/__init__.py | Stanley-Y/QuecOpen | 372403f19507a19d26750a5cec422b7ba31390e6 | [
"MIT"
] | null | null | null | tools/partition_make/common/build/lib/__init__.py | Stanley-Y/QuecOpen | 372403f19507a19d26750a5cec422b7ba31390e6 | [
"MIT"
] | 9 | 2019-04-02T14:40:12.000Z | 2022-03-30T08:19:36.000Z | 'lib'
| 3 | 5 | 0.5 |
7960a0e519d10907e09aa026af0442a151893855 | 4,956 | py | Python | tools/transfer_to_coco_json_origin.py | DeLightCMU/MAL | a03d4d3ed2ea4200ac6b4c6d980f3138b29d94ee | [
"MIT"
] | 13 | 2020-09-05T11:15:10.000Z | 2021-07-26T08:12:28.000Z | tools/transfer_to_coco_json_origin.py | DeLightCMU/MAL | a03d4d3ed2ea4200ac6b4c6d980f3138b29d94ee | [
"MIT"
] | null | null | null | tools/transfer_to_coco_json_origin.py | DeLightCMU/MAL | a03d4d3ed2ea4200ac6b4c6d980f3138b29d94ee | [
"MIT"
] | 3 | 2020-11-26T03:54:58.000Z | 2021-07-26T08:12:33.000Z | import json
import os
import cv2
# 根路径,里面包含images(图片文件夹),annos.txt(bbox标注),classes.txt(类别标签),以及annotations文件夹(如果没有则会自动创建,用于保存最后的json)
root_path = '/data3/brad/data/VisDrone2019/'
# 用于创建训练集或验证集
phase = 'train'
# 训练集和验证集划分的界线
split = 8000
# 打开类别标签
# with open(os.path.join(root_path, 'classes.txt')) as f... | 35.148936 | 145 | 0.535311 |
7960a1cf0ce0a5f12ff0003c0dbad8f8d8eddaaa | 850 | py | Python | oo/pessoa.py | ruygomes/pythonbirds | e117de545e3fb27fe767ec62b83f039b36634685 | [
"MIT"
] | null | null | null | oo/pessoa.py | ruygomes/pythonbirds | e117de545e3fb27fe767ec62b83f039b36634685 | [
"MIT"
] | null | null | null | oo/pessoa.py | ruygomes/pythonbirds | e117de545e3fb27fe767ec62b83f039b36634685 | [
"MIT"
] | null | null | null | class Pessoa:
olhos=2
def __init__(self, *filhos, nome=None, idade=35):
self.idade = idade
self.nome = nome
self.filhos = list(filhos)
def cumprimentar(self):
return f'Olá {id(self)}'
if __name__ == '__main__':
renzo = Pessoa(nome='Renzo')
luciano = Pessoa(renzo, no... | 27.419355 | 63 | 0.644706 |
7960a1ebe0ff7edfd31ef2f7a985baf4f7ca62fd | 752 | py | Python | pennylane_qsharp/__init__.py | XanaduAI/PennyLane-qsharp | 331c0933c7fe6b883cdb6d6219038c9b2f15831d | [
"Apache-2.0"
] | 8 | 2019-05-02T19:54:52.000Z | 2020-07-15T05:27:25.000Z | pennylane_qsharp/__init__.py | PennyLaneAI/PennyLane-qsharp | 3f93e473a2503237287da1442312aac399543643 | [
"Apache-2.0"
] | 6 | 2020-08-10T11:32:08.000Z | 2022-03-29T17:24:09.000Z | pennylane_qsharp/__init__.py | PennyLaneAI/PennyLane-qsharp | 3f93e473a2503237287da1442312aac399543643 | [
"Apache-2.0"
] | 3 | 2020-10-15T14:40:19.000Z | 2021-09-07T01:26:41.000Z | # Copyright 2019 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agre... | 35.809524 | 74 | 0.756649 |
7960a39726e5e18f3a6fce765202ec4fd4e7a784 | 2,709 | py | Python | editregions/views.py | kezabelle/django-editregions | 961ddeffb37d30d40fb4e3e9224bc3f956b7a5b5 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2015-01-11T18:21:27.000Z | 2015-01-11T18:21:27.000Z | editregions/views.py | kezabelle/django-editregions | 961ddeffb37d30d40fb4e3e9224bc3f956b7a5b5 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | editregions/views.py | kezabelle/django-editregions | 961ddeffb37d30d40fb4e3e9224bc3f956b7a5b5 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | # -*- coding: utf-8 -*-
import logging
from django.contrib import messages
from django.shortcuts import redirect
logger = logging.getLogger(__name__)
class FormSuccess(Exception):
__slots__ = ['location', 'msg', 'message', 'permanent']
def __init__(self, location, msg=None, permanent=False):
self.lo... | 33.036585 | 77 | 0.605759 |
7960a3be222375d251bed530ce9e949646247aa4 | 3,949 | py | Python | sideline/settings.py | ablades/sideline | 8a153da3da0cb0de84cd15751c055f4c625f2f5f | [
"MIT"
] | 1 | 2020-05-11T08:32:01.000Z | 2020-05-11T08:32:01.000Z | sideline/settings.py | ablades/sideline | 8a153da3da0cb0de84cd15751c055f4c625f2f5f | [
"MIT"
] | 7 | 2021-03-19T00:25:46.000Z | 2022-03-12T00:22:45.000Z | sideline/settings.py | ablades/sideline | 8a153da3da0cb0de84cd15751c055f4c625f2f5f | [
"MIT"
] | null | null | null | """
Django settings for sideline project.
Generated by 'django-admin startproject' using Django 2.2.6.
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/
"""
import os
... | 26.682432 | 91 | 0.699164 |
7960a3ce80905c66e9a3cdaf13215a9178aea7b5 | 23 | py | Python | components/idf_test/integration_test/TestCaseScript/WiFiStress/__init__.py | Mixerito/esp-idf | 20a662936483f44ee9c8d16f3251a5a1191ca6e5 | [
"Apache-2.0"
] | 104 | 2017-05-04T09:55:08.000Z | 2022-03-22T11:29:05.000Z | components/idf_test/integration_test/TestCaseScript/WiFiStress/__init__.py | Mixerito/esp-idf | 20a662936483f44ee9c8d16f3251a5a1191ca6e5 | [
"Apache-2.0"
] | 28 | 2017-08-01T09:19:23.000Z | 2017-12-26T13:41:14.000Z | components/idf_test/integration_test/TestCaseScript/WiFiStress/__init__.py | Mixerito/esp-idf | 20a662936483f44ee9c8d16f3251a5a1191ca6e5 | [
"Apache-2.0"
] | 59 | 2016-11-15T06:07:56.000Z | 2022-02-05T17:03:32.000Z | __all__ = ["WifiJAP", ] | 23 | 23 | 0.608696 |
7960a4b409958e29d71de7cdab9662531478c67c | 555 | py | Python | rat-sql-gap/seq2struct/utils/serialization.py | SSamDav/gap-text2sql | 618df3e82f66bf64c9e8220e81d46324f5144bcf | [
"Apache-2.0"
] | 280 | 2020-07-05T08:29:22.000Z | 2022-03-24T09:11:31.000Z | rat-sql-gap/seq2struct/utils/serialization.py | alan-ai-learner/gap-text2sql | c90d4e039123db9c57568d1a005b19e6d35df5ea | [
"Apache-2.0"
] | 62 | 2020-07-09T00:26:59.000Z | 2022-03-22T20:57:26.000Z | rat-sql-gap/seq2struct/utils/serialization.py | alan-ai-learner/gap-text2sql | c90d4e039123db9c57568d1a005b19e6d35df5ea | [
"Apache-2.0"
] | 105 | 2020-07-05T07:11:48.000Z | 2022-03-30T06:53:46.000Z | def to_dict_with_sorted_values(d, key=None):
return {k: sorted(v, key=key) for k, v in d.items()}
def to_dict_with_set_values(d):
result = {}
for k, v in d.items():
hashable_v = []
for v_elem in v:
if isinstance(v_elem, list):
hashable_v.append(tuple(v_elem))
... | 24.130435 | 56 | 0.576577 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.