hexsha stringlengths 40 40 | size int64 5 2.06M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 248 | max_stars_repo_name stringlengths 5 125 | 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 248 | max_issues_repo_name stringlengths 5 125 | 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 248 | max_forks_repo_name stringlengths 5 125 | 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 5 2.06M | avg_line_length float64 1 1.02M | max_line_length int64 3 1.03M | alphanum_fraction float64 0 1 | count_classes int64 0 1.6M | score_classes float64 0 1 | count_generators int64 0 651k | score_generators float64 0 1 | count_decorators int64 0 990k | score_decorators float64 0 1 | count_async_functions int64 0 235k | score_async_functions float64 0 1 | count_documentation int64 0 1.04M | score_documentation float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
28e8716a746cdb6acac715e98c28629d494e1a7a | 1,720 | py | Python | Reporting/urllib2_report_data.py | hbuter-rubrik/rubrik-scripts-for-python | 0e434854b778ff0f857425173e5cb7d6b83dddec | [
"MIT"
] | 5 | 2019-10-04T18:09:24.000Z | 2020-08-25T04:46:01.000Z | Reporting/urllib2_report_data.py | hbuter-rubrik/rubrik-scripts-for-python | 0e434854b778ff0f857425173e5cb7d6b83dddec | [
"MIT"
] | 2 | 2020-01-07T18:25:11.000Z | 2021-10-14T11:48:27.000Z | Reporting/urllib2_report_data.py | hbuter-rubrik/rubrik-scripts-for-python | 0e434854b778ff0f857425173e5cb7d6b83dddec | [
"MIT"
] | 6 | 2019-04-25T10:26:30.000Z | 2021-11-18T08:20:50.000Z | import urllib2
import json
import base64
import time
import ssl
"""
define our rubrik credentials
"""
RUBRIK_IP='rubrik.demo.com'
RUBRIK_USER='admin'
RUBRIK_PASS='mypassword123!'
"""
ignore self-signed certs
"""
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
# get the repo... | 33.076923 | 123 | 0.699419 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 526 | 0.305814 |
28e92acc31d96b35a53502cfb20ad7033a7cf662 | 2,476 | py | Python | f_net/main.py | DionysisChristopoulos/google-research | 7f59ef421beef32ca16c2a7215be74f7eba01a0f | [
"Apache-2.0"
] | 2 | 2021-09-04T09:08:38.000Z | 2021-09-04T09:08:44.000Z | f_net/main.py | DionysisChristopoulos/google-research | 7f59ef421beef32ca16c2a7215be74f7eba01a0f | [
"Apache-2.0"
] | null | null | null | f_net/main.py | DionysisChristopoulos/google-research | 7f59ef421beef32ca16c2a7215be74f7eba01a0f | [
"Apache-2.0"
] | 5 | 2021-11-25T07:40:17.000Z | 2022-03-22T11:13:39.000Z | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 32.578947 | 83 | 0.735057 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,156 | 0.466882 |
28e9489a4ce0811a2281acebf64dae5129d76367 | 18,341 | py | Python | mypyext/ml.py | VolkiTheDreamer/PythonRocks | f7b6cdf335687c6d111bf08387965ca3ecddd504 | [
"Apache-2.0"
] | null | null | null | mypyext/ml.py | VolkiTheDreamer/PythonRocks | f7b6cdf335687c6d111bf08387965ca3ecddd504 | [
"Apache-2.0"
] | null | null | null | mypyext/ml.py | VolkiTheDreamer/PythonRocks | f7b6cdf335687c6d111bf08387965ca3ecddd504 | [
"Apache-2.0"
] | 2 | 2019-10-04T10:56:14.000Z | 2022-03-06T18:18:59.000Z | import numpy as np
import pandas as pd
from sklearn.metrics import silhouette_samples, silhouette_score
from sklearn.metrics import confusion_matrix, accuracy_score, recall_score, precision_score, f1_score,roc_auc_score,roc_curve
from sklearn.metrics import mean_squared_error,mean_absolute_error,r2_score
import ma... | 38.531513 | 213 | 0.601876 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5,933 | 0.32152 |
28eb9384d1558fa0c10861f56ac8ad811737befd | 845 | py | Python | src/isaw.theme/isaw/theme/browser/viewlets/zotero.py | isawnyu/isaw.web | 604499f9fa55d1ce9698ca05f85ddb54a88f1cab | [
"CC-BY-3.0"
] | null | null | null | src/isaw.theme/isaw/theme/browser/viewlets/zotero.py | isawnyu/isaw.web | 604499f9fa55d1ce9698ca05f85ddb54a88f1cab | [
"CC-BY-3.0"
] | 405 | 2015-03-12T18:20:25.000Z | 2022-03-07T18:44:16.000Z | src/isaw.theme/isaw/theme/browser/viewlets/zotero.py | isawnyu/isaw.web | 604499f9fa55d1ce9698ca05f85ddb54a88f1cab | [
"CC-BY-3.0"
] | 1 | 2016-11-07T21:18:49.000Z | 2016-11-07T21:18:49.000Z | import re
from urlparse import urlparse
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from plone.app.layout.viewlets.common import ViewletBase
ZOTERO_JSON_BASE = 'https://api.zotero.org{}?v=3&format=json'
Z_MATCH = re.compile(r'^/(groups|users)/\d+/items/[A-Z1-9]+$')
class PublicationZotero... | 33.8 | 71 | 0.695858 | 547 | 0.647337 | 0 | 0 | 0 | 0 | 0 | 0 | 128 | 0.151479 |
28ec2d89ad8ce29a9ec68a6cf207b6114836df8c | 1,079 | py | Python | descender.py | illBeRoy/tldr-of-the-world-data | 06d581eb117bdc79ebbe7af4f8ae4b26190d7231 | [
"MIT"
] | null | null | null | descender.py | illBeRoy/tldr-of-the-world-data | 06d581eb117bdc79ebbe7af4f8ae4b26190d7231 | [
"MIT"
] | null | null | null | descender.py | illBeRoy/tldr-of-the-world-data | 06d581eb117bdc79ebbe7af4f8ae4b26190d7231 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import argparse
import json
import jinja2
import webbrowser
import graph
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('groups', help='json file describing seed groups')
args = parser.parse_args()
# load group from file
with open(args.gro... | 28.394737 | 100 | 0.656163 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 401 | 0.37164 |
28ee6695911d76e64bcea52634f3ac6a4cf51dda | 268 | py | Python | picompile/types.py | pfalcon/picompile | 7724e629e3ffc48b066c938d7f02b5f4e8276051 | [
"MIT"
] | 3 | 2020-01-28T03:54:06.000Z | 2021-02-25T14:38:50.000Z | picompile/types.py | pfalcon/picompile | 7724e629e3ffc48b066c938d7f02b5f4e8276051 | [
"MIT"
] | null | null | null | picompile/types.py | pfalcon/picompile | 7724e629e3ffc48b066c938d7f02b5f4e8276051 | [
"MIT"
] | null | null | null | "Actual (primitive) types instanitated in the type system."
import sys
from .typesys import *
class np:
# Dummy
class ndarray:
pass
int32 = TCon("Int32")
int64 = TCon("Int64")
float32 = TCon("Float")
double64 = TCon("Double")
void = TCon("Void")
| 14.105263 | 59 | 0.652985 | 53 | 0.197761 | 0 | 0 | 0 | 0 | 0 | 0 | 101 | 0.376866 |
28f158e00bdef100d0ce90ce07f81579244e0faa | 2,735 | py | Python | tests/fraction_tests/test_neg.py | davideguidobene/cfractions | 2fc33d3ddf972e07787bdc99443868137999e114 | [
"MIT"
] | 3 | 2022-01-18T21:17:17.000Z | 2022-01-23T21:49:52.000Z | tests/fraction_tests/test_neg.py | davideguidobene/cfractions | 2fc33d3ddf972e07787bdc99443868137999e114 | [
"MIT"
] | 3 | 2021-06-28T13:30:58.000Z | 2022-01-16T19:05:00.000Z | tests/fraction_tests/test_neg.py | davideguidobene/cfractions | 2fc33d3ddf972e07787bdc99443868137999e114 | [
"MIT"
] | 1 | 2021-10-22T02:12:06.000Z | 2021-10-22T02:12:06.000Z | import sys
from numbers import Real
from hypothesis import given
from cfractions import Fraction
from tests.utils import (equivalence,
is_fraction_valid,
skip_reference_counter_test)
from . import strategies
@given(strategies.fractions)
def test_basic(fraction: Frac... | 30.054945 | 78 | 0.729433 | 0 | 0 | 0 | 0 | 2,436 | 0.890676 | 0 | 0 | 0 | 0 |
28f37ae0b38a0ca393af612ee52d0d305a27311a | 336 | py | Python | flag/parser.py | danielchatfield/flag | e4c2bea2a74a428b9fdf7bf350e218c8cd71fdc5 | [
"MIT"
] | 2 | 2016-06-26T22:16:08.000Z | 2020-08-15T12:20:18.000Z | flag/parser.py | danielchatfield/flag | e4c2bea2a74a428b9fdf7bf350e218c8cd71fdc5 | [
"MIT"
] | null | null | null | flag/parser.py | danielchatfield/flag | e4c2bea2a74a428b9fdf7bf350e218c8cd71fdc5 | [
"MIT"
] | 1 | 2020-08-15T12:21:12.000Z | 2020-08-15T12:21:12.000Z | # -*- coding: utf-8 -*-
"""
flag.parser
~~~~~~~~~~~
"""
import argparse
from . import registry
def parse():
parser = argparse.ArgumentParser()
for flag in registry.iter():
flag.add_to_parser(parser)
args = vars(parser.parse_args())
for flag in registry.iter():
flag.update(a... | 16 | 38 | 0.592262 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 62 | 0.184524 |
28f476813b8879c19e3170513ebfab33d088e25a | 93 | py | Python | ror/number_utils.py | jakub-tomczak/ror | cf9ab38a2d66f4816a1289b9726911960059fce7 | [
"MIT"
] | null | null | null | ror/number_utils.py | jakub-tomczak/ror | cf9ab38a2d66f4816a1289b9726911960059fce7 | [
"MIT"
] | null | null | null | ror/number_utils.py | jakub-tomczak/ror | cf9ab38a2d66f4816a1289b9726911960059fce7 | [
"MIT"
] | null | null | null | def format_number(number: float, precision: int) -> str:
return f'{number:.{precision}f}' | 46.5 | 56 | 0.698925 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 25 | 0.268817 |
28f54f1fb9cdd4025290b813dd74c2874e584666 | 14,375 | py | Python | 4_Model_Updater/train_new_model.py | kshahnazari1998/SmartDota-Public | 270ddabfd353c57e754c00b7a5365d99f4d5902f | [
"MIT"
] | null | null | null | 4_Model_Updater/train_new_model.py | kshahnazari1998/SmartDota-Public | 270ddabfd353c57e754c00b7a5365d99f4d5902f | [
"MIT"
] | null | null | null | 4_Model_Updater/train_new_model.py | kshahnazari1998/SmartDota-Public | 270ddabfd353c57e754c00b7a5365d99f4d5902f | [
"MIT"
] | null | null | null | import json
import pandas as pd
import numpy as np
import random
from Sqldatabasehandler import sqlhandler
from datetime import datetime
from sklearn.linear_model import SGDClassifier
from sklearn.preprocessing import PolynomialFeatures
import pickle
import torch
from torch import nn
import torch.optim as optim
from ... | 36.209068 | 88 | 0.517704 | 13,307 | 0.925704 | 0 | 0 | 0 | 0 | 0 | 0 | 1,630 | 0.113391 |
28f6f0c2610028a27b78a080b28387f6adc1ab80 | 2,227 | py | Python | meshrcnn/structures/mask.py | MAYURGAIKWAD/meshrcnn | b47ecd47ca7de7055b7d141e63ddab286c5245f3 | [
"BSD-3-Clause"
] | 1,028 | 2020-01-23T23:30:54.000Z | 2022-03-27T22:33:50.000Z | meshrcnn/structures/mask.py | MAYURGAIKWAD/meshrcnn | b47ecd47ca7de7055b7d141e63ddab286c5245f3 | [
"BSD-3-Clause"
] | 103 | 2020-01-24T05:29:48.000Z | 2022-03-08T13:04:24.000Z | meshrcnn/structures/mask.py | MAYURGAIKWAD/meshrcnn | b47ecd47ca7de7055b7d141e63ddab286c5245f3 | [
"BSD-3-Clause"
] | 179 | 2020-01-24T08:14:30.000Z | 2022-03-19T00:34:05.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import torch
from torch.nn import functional as F
def crop_mask_within_box(mask, box, mask_size):
"""
Crop the mask content in the given box.
The cropped mask is resized to (mask_size, mask_size).
This function is used when genera... | 34.796875 | 97 | 0.68388 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,324 | 0.594522 |
28f7bcf0fe258f3b0b26915576f9434aa6d0a9ec | 1,727 | py | Python | app/controller/org.py | Jimmy-Xu/fastapi_demo | f19c629cc7fa0e0e47e73e8688cd019bc74aa982 | [
"MIT"
] | 12 | 2020-09-01T09:19:41.000Z | 2022-03-17T05:48:50.000Z | app/controller/org.py | Jimmy-Xu/fastapi_demo | f19c629cc7fa0e0e47e73e8688cd019bc74aa982 | [
"MIT"
] | null | null | null | app/controller/org.py | Jimmy-Xu/fastapi_demo | f19c629cc7fa0e0e47e73e8688cd019bc74aa982 | [
"MIT"
] | 3 | 2021-04-26T02:53:04.000Z | 2021-11-01T14:32:38.000Z | from fastapi import APIRouter, Depends
from fastapi_plus.schema.base import ListArgsSchema, RespListSchema, RespIdSchema, RespBaseSchema
from fastapi_plus.utils.auth import get_auth_data
from fastapi_plus.utils.custom_route import CustomRoute
from ..schema.org import OrgInfoSchema, OrgRespDetailSchema
from ..service.o... | 27.412698 | 97 | 0.712218 | 0 | 0 | 0 | 0 | 1,452 | 0.783594 | 1,155 | 0.623314 | 465 | 0.250944 |
28f8e1f5d1a46da294aab0598c860ad545a8ca7d | 652 | py | Python | gds/blueprint/api/__init__.py | UniqueHK/pholcus | bf14621cf1fcd3517f2bbca7f9a7e73ee06cbf4a | [
"MIT"
] | 4 | 2015-12-15T06:06:40.000Z | 2016-06-20T07:52:06.000Z | gds/blueprint/api/__init__.py | UniqueHK/pholcus | bf14621cf1fcd3517f2bbca7f9a7e73ee06cbf4a | [
"MIT"
] | 1 | 2016-02-02T04:35:16.000Z | 2016-02-02T04:35:16.000Z | gds/blueprint/api/__init__.py | UniqueHK/pholcus | bf14621cf1fcd3517f2bbca7f9a7e73ee06cbf4a | [
"MIT"
] | 1 | 2015-07-22T12:17:08.000Z | 2015-07-22T12:17:08.000Z | #!/usr/bin/env python
# coding=utf8
import os
TOP = os.path.abspath('.')
STATIC = os.path.join(os.path.abspath('.'), 'static', 'exe')
ALLOWED_EXTENSIONS = set(['py'])
def allowed(filename):
return '.' in filename and filename.rsplit('.')[-1] in ALLOWED_EXTENSIONS
def exepath(filename):
filepath = os.path.joi... | 25.076923 | 77 | 0.673313 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 66 | 0.101227 |
28f8fe78a081d406b2ab32ded6242237cf670fed | 1,896 | py | Python | tests/refarm_redirects/test_views.py | fidals/blog | 2815b43d6724b142cc663a8cdc59d2afc9cad657 | [
"MIT"
] | 3 | 2017-05-05T12:01:54.000Z | 2018-03-06T21:33:04.000Z | tests/refarm_redirects/test_views.py | fidals/blog | 2815b43d6724b142cc663a8cdc59d2afc9cad657 | [
"MIT"
] | 172 | 2016-11-30T18:18:41.000Z | 2022-03-11T23:20:58.000Z | tests/refarm_redirects/test_views.py | fidals/blog | 2815b43d6724b142cc663a8cdc59d2afc9cad657 | [
"MIT"
] | 3 | 2017-09-25T17:11:46.000Z | 2020-04-17T09:14:43.000Z | import unittest
from django.contrib.redirects.models import Redirect
from django.contrib.sites.models import Site
from django.db.utils import IntegrityError
from django.test import TestCase
class Redirects(TestCase):
def test_redirect_from_existing_page(self):
"""`refarm-site.redirects` app should redir... | 37.176471 | 80 | 0.639241 | 1,702 | 0.897679 | 0 | 0 | 627 | 0.330696 | 0 | 0 | 930 | 0.490506 |
28f9b230456479c535d2d51167428a69e99f40fe | 1,448 | py | Python | src/super_gradients/training/models/__init__.py | karndeepsingh/super-gradients | bfed440ecaf485af183570bf965eb5b74cb9f832 | [
"Apache-2.0"
] | 1 | 2022-01-15T19:33:06.000Z | 2022-01-15T19:33:06.000Z | src/super_gradients/training/models/__init__.py | karndeepsingh/super-gradients | bfed440ecaf485af183570bf965eb5b74cb9f832 | [
"Apache-2.0"
] | null | null | null | src/super_gradients/training/models/__init__.py | karndeepsingh/super-gradients | bfed440ecaf485af183570bf965eb5b74cb9f832 | [
"Apache-2.0"
] | null | null | null | # flake8: noqa # FIXME: find sol for F403 error (caused by import *), most likely need to import everything by hand
from .sg_module import *
from super_gradients.training.models.classification_models.densenet import *
from super_gradients.training.models.classification_models.dpn import *
from super_gradients.training.... | 68.952381 | 115 | 0.870166 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 115 | 0.07942 |
28fa10ec4cb7ea617432d1a843efa65bb4d46c15 | 2,327 | py | Python | nerodia/alert.py | harsh183/nerodia | 69c5e4408432e85b5af0b2da03015f729809dac4 | [
"MIT"
] | 83 | 2017-11-20T08:41:09.000Z | 2022-02-09T21:01:47.000Z | nerodia/alert.py | harsh183/nerodia | 69c5e4408432e85b5af0b2da03015f729809dac4 | [
"MIT"
] | 28 | 2017-11-21T02:25:03.000Z | 2021-04-15T15:26:30.000Z | nerodia/alert.py | harsh183/nerodia | 69c5e4408432e85b5af0b2da03015f729809dac4 | [
"MIT"
] | 14 | 2017-11-29T06:44:12.000Z | 2021-09-06T04:53:44.000Z | from selenium.common.exceptions import NoAlertPresentException
import nerodia
from .exception import UnknownObjectException
from .wait.wait import Waitable, TimeoutError
class Alert(Waitable):
def __init__(self, browser):
self.browser = browser
self.alert = None
@property
def text(self):... | 23.039604 | 83 | 0.581006 | 2,153 | 0.925226 | 0 | 0 | 647 | 0.27804 | 0 | 0 | 863 | 0.370864 |
28fa6ae216b4aa0d88457aec32b09566f1611604 | 1,448 | py | Python | finetwork/distance_calculator/distance_calculator.py | annakuchko/FinNetwork | 4566ff96b33fb5668f9b28f41a94791d1cf9249c | [
"MIT"
] | 5 | 2021-12-07T22:14:10.000Z | 2022-03-30T14:09:15.000Z | finetwork/distance_calculator/distance_calculator.py | annakuchko/FinNetwork | 4566ff96b33fb5668f9b28f41a94791d1cf9249c | [
"MIT"
] | null | null | null | finetwork/distance_calculator/distance_calculator.py | annakuchko/FinNetwork | 4566ff96b33fb5668f9b28f41a94791d1cf9249c | [
"MIT"
] | null | null | null | from finetwork.distance_calculator import _distance_metrics
import pandas as pd
class CalculateDistance:
def __init__(self, data, method='pearson', scaled=False, sigma = 0.5):
self.data = data
self.method = method
self.scaled = scaled
self.sigma = sigma
... | 34.47619 | 78 | 0.462017 | 1,362 | 0.940608 | 0 | 0 | 0 | 0 | 0 | 0 | 55 | 0.037983 |
28fc0673c7bc0e68a3641dedb06915366e9c6c39 | 27,818 | py | Python | aprastreioWin.py | Alexsussa/aprastreio | 1159861edd932f61a849f63f9dc7e5d34b2f272b | [
"MIT"
] | null | null | null | aprastreioWin.py | Alexsussa/aprastreio | 1159861edd932f61a849f63f9dc7e5d34b2f272b | [
"MIT"
] | null | null | null | aprastreioWin.py | Alexsussa/aprastreio | 1159861edd932f61a849f63f9dc7e5d34b2f272b | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- encoding: utf-8 -*-
__version__ = 1.2
from tkinter.ttk import *
from tkinter.messagebox import *
from tkinter.scrolledtext import *
from tkinter import *
from bs4 import BeautifulSoup
from urllib.request import urlopen
from mailcomposer import MailComposer
from threading import Thread
import ... | 46.910624 | 225 | 0.60752 | 24,583 | 0.881743 | 0 | 0 | 0 | 0 | 0 | 0 | 8,847 | 0.317324 |
28fcf00920c199ce0f0b62aba120f4cb4d0c324d | 5,480 | py | Python | samples/attributes.py | DavidJohnGee/clicrud | f1f178ac44649efe7b7681d37e97d2632b8971b2 | [
"Apache-2.0"
] | 9 | 2015-12-07T23:00:24.000Z | 2021-06-23T21:31:47.000Z | samples/attributes.py | DavidJohnGee/clicrud | f1f178ac44649efe7b7681d37e97d2632b8971b2 | [
"Apache-2.0"
] | 8 | 2016-04-05T12:36:54.000Z | 2017-05-15T16:00:08.000Z | samples/attributes.py | DavidJohnGee/clicrud | f1f178ac44649efe7b7681d37e97d2632b8971b2 | [
"Apache-2.0"
] | 7 | 2016-06-02T23:39:05.000Z | 2021-03-25T20:52:46.000Z | #!/usr/bin/env python
"""
Copyright 2015 Brocade Communications 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 appl... | 37.793103 | 77 | 0.534672 | 4,855 | 0.885949 | 0 | 0 | 0 | 0 | 0 | 0 | 2,172 | 0.39635 |
28fd8a0aa5ca53d8cc4ae5edc75046373f2c1af3 | 1,929 | py | Python | Q36_reversePairs.py | FreesiaLikesPomelo/-offer | 14ac73cb46d13c7f5bbc294329a14f3c5995bc7a | [
"Apache-2.0"
] | null | null | null | Q36_reversePairs.py | FreesiaLikesPomelo/-offer | 14ac73cb46d13c7f5bbc294329a14f3c5995bc7a | [
"Apache-2.0"
] | null | null | null | Q36_reversePairs.py | FreesiaLikesPomelo/-offer | 14ac73cb46d13c7f5bbc294329a14f3c5995bc7a | [
"Apache-2.0"
] | null | null | null | '''
面试题51. 数组中的逆序对
在数组中的两个数字,如果前面一个数字大于后面的数字,则这两个数字组成一个逆序对。输入一个数组,求出这个数组中的逆序对的总数。
示例 1:
输入: [7,5,6,4]
输出: 5
限制:
0 <= 数组长度 <= 50000
https://leetcode-cn.com/problems/shu-zu-zhong-de-ni-xu-dui-lcof/
执行用时 :1564 ms, 在所有 Python3 提交中击败了85.67%的用户
内存消耗 :18.5 MB, 在所有 Python3 提交中击败了100.00%的用户
'''
# merge-sort
# test cases:
# 1... | 26.424658 | 64 | 0.524624 | 1,531 | 0.707813 | 0 | 0 | 0 | 0 | 0 | 0 | 728 | 0.33657 |
28fd8b4c1c5abdea704fd69e0b99370a0f6f8997 | 21,954 | py | Python | Apps/phgreynoise/greynoise_connector.py | ryanbsaunders/phantom-apps | 1befda793a08d366fbd443894f993efb1baf9635 | [
"Apache-2.0"
] | 2 | 2021-07-23T03:51:30.000Z | 2021-08-12T14:13:04.000Z | Apps/phgreynoise/greynoise_connector.py | ryanbsaunders/phantom-apps | 1befda793a08d366fbd443894f993efb1baf9635 | [
"Apache-2.0"
] | 4 | 2021-10-04T09:22:02.000Z | 2021-11-01T12:00:04.000Z | Apps/phgreynoise/greynoise_connector.py | ryanbsaunders/phantom-apps | 1befda793a08d366fbd443894f993efb1baf9635 | [
"Apache-2.0"
] | 2 | 2021-05-15T17:31:24.000Z | 2021-07-23T03:51:42.000Z | # File: greynoise_connector.py
#
# Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)
# Python 3 Compatibility imports
from __future__ import print_function, unicode_literals
# Phantom App imports
import phantom.app as phantom
from phantom.base_connector import BaseConnector
from phantom.acti... | 38.856637 | 123 | 0.579029 | 19,245 | 0.876606 | 0 | 0 | 0 | 0 | 0 | 0 | 3,858 | 0.175731 |
28ff0f386d7b1dca0a607e85432309e87a77eb9e | 1,044 | py | Python | nntransfer/trainer/main_loop_modules/main_loop_module.py | sinzlab/nntransfer | 78622feb568b1cc50ac0f73c8297f9785876a659 | [
"MIT"
] | null | null | null | nntransfer/trainer/main_loop_modules/main_loop_module.py | sinzlab/nntransfer | 78622feb568b1cc50ac0f73c8297f9785876a659 | [
"MIT"
] | null | null | null | nntransfer/trainer/main_loop_modules/main_loop_module.py | sinzlab/nntransfer | 78622feb568b1cc50ac0f73c8297f9785876a659 | [
"MIT"
] | 2 | 2021-07-30T08:39:04.000Z | 2022-03-01T16:26:11.000Z | class MainLoopModule(object):
def __init__(self, trainer):
self.trainer = trainer
self.train_loader = trainer.data_loaders["train"]
self.config = trainer.config
self.device = trainer.device
self.seed = trainer.seed
self.tracker = self.trainer.tracker
self.crit... | 28.216216 | 68 | 0.612069 | 1,043 | 0.999042 | 0 | 0 | 0 | 0 | 0 | 0 | 19 | 0.018199 |
28ff68d107d4e01cf5ece21ad9bb66128f102b8f | 373 | py | Python | src/pgbackup/pgdump.py | narbutas/pgbackup | 2bc65dc9c4cdba135e0ae68c71d034de50fddda8 | [
"Apache-2.0"
] | null | null | null | src/pgbackup/pgdump.py | narbutas/pgbackup | 2bc65dc9c4cdba135e0ae68c71d034de50fddda8 | [
"Apache-2.0"
] | null | null | null | src/pgbackup/pgdump.py | narbutas/pgbackup | 2bc65dc9c4cdba135e0ae68c71d034de50fddda8 | [
"Apache-2.0"
] | null | null | null | import subprocess
import sys
def dump(url):
try:
return subprocess.Popen(['pg_dump', url], stdout=subprocess.PIPE)
except OSError as err:
print(f"Error: {err}")
sys.exit(1)
def dump_file_name(url, timestamp=None):
db_name = url.split('/')[-1]
db_name = db_name.split('?')[0]
if timestamp:
return f"{db_na... | 21.941176 | 67 | 0.686327 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 74 | 0.198391 |
e900f1fbad104966ef7247511d53bc745e2f6385 | 1,190 | py | Python | e2_s13.py | iansantana00/Python-Course | 43852aa64c93099342ab4765b0fe8729a959449e | [
"MIT"
] | 2 | 2022-01-13T15:55:58.000Z | 2022-02-11T23:18:34.000Z | e2_s13.py | iansantana00/Python-Course | 43852aa64c93099342ab4765b0fe8729a959449e | [
"MIT"
] | null | null | null | e2_s13.py | iansantana00/Python-Course | 43852aa64c93099342ab4765b0fe8729a959449e | [
"MIT"
] | null | null | null | numero_vogal = 0
espaço = 0
numero_consoante = 0
contador = 0
escrita = 0
arquivo = input('Digite o nome do seu arquivo (.txt): ')
with open(arquivo, 'w', encoding='utf-8') as texto:
while escrita != 'sair':
escrita = input('Digite: ')
texto.write(escrita)
texto.write(... | 30.512821 | 117 | 0.443697 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 466 | 0.382281 |
e903d12f8a04e71c8c2140ed40144f3db69c7ec2 | 7,249 | py | Python | app/sso/tests/providers/test_oauth2_google_views.py | getmetamapper/metamapper | 0b2f67eec03fbf7ece35ff9f58ea9bb2dde4d85f | [
"BSD-2-Clause"
] | 53 | 2020-07-01T23:11:59.000Z | 2022-03-31T19:10:28.000Z | app/sso/tests/providers/test_oauth2_google_views.py | metamapper-io/metamapper | 376716e72bcaca62f1ec09ca9a13a0346e5502f9 | [
"BSD-2-Clause"
] | 5 | 2020-11-25T19:48:57.000Z | 2022-02-27T23:50:18.000Z | app/sso/tests/providers/test_oauth2_google_views.py | metamapper-io/metamapper | 376716e72bcaca62f1ec09ca9a13a0346e5502f9 | [
"BSD-2-Clause"
] | 5 | 2020-08-29T16:43:59.000Z | 2022-01-17T19:05:30.000Z | # -*- coding: utf-8 -*-
from base64 import b64encode, b64decode
from unittest import mock
from django.conf import settings
from django.http import HttpResponseRedirect
from django.test import TestCase, Client
from django.urls import reverse
from testutils import factories
from urllib.parse import urlparse, parse_qs
... | 36.611111 | 116 | 0.626983 | 6,924 | 0.955166 | 0 | 0 | 6,186 | 0.853359 | 0 | 0 | 2,051 | 0.282936 |
e903dc912d5bbd81aedab3090527461e1da894a1 | 2,843 | py | Python | mammoth/ensembl.py | hbc/mammoth_code | 2e6909514e8ff232981ea2cb03f078257bc5c847 | [
"MIT"
] | 1 | 2017-05-22T01:18:13.000Z | 2017-05-22T01:18:13.000Z | mammoth/ensembl.py | hbc/mammoth_code | 2e6909514e8ff232981ea2cb03f078257bc5c847 | [
"MIT"
] | null | null | null | mammoth/ensembl.py | hbc/mammoth_code | 2e6909514e8ff232981ea2cb03f078257bc5c847 | [
"MIT"
] | null | null | null | """ensembl interaction function"""
import os
import requests, sys
import yaml
import logging
import gffutils
from collections import defaultdict
import mammoth.logger as mylog
server = "http://rest.ensembl.org{ext}"
ext = "/sequence/id/{id}?type=cds"
prot = "/sequence/id/{id}?type=protein"
sequence = "/sequence/reg... | 38.418919 | 133 | 0.570172 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 539 | 0.189588 |
e904784d726457730b96e531625f80ef01e860f9 | 906 | py | Python | test/top.py | persianpros/transmissionrpc | 5e6a8487ca7684459ef9d3b375b207535ae2b9dd | [
"MIT"
] | null | null | null | test/top.py | persianpros/transmissionrpc | 5e6a8487ca7684459ef9d3b375b207535ae2b9dd | [
"MIT"
] | null | null | null | test/top.py | persianpros/transmissionrpc | 5e6a8487ca7684459ef9d3b375b207535ae2b9dd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# 2013-03, Erik Svensson <erik.public@gmail.com>
# Licensed under the MIT license.
import unittest
import transmissionrpc
class TopTest(unittest.TestCase):
def testConstants(self):
self.assertTrue(isinstance(transmissionrpc.__author__, str))
self.assertTrue(isin... | 39.391304 | 142 | 0.738411 | 649 | 0.716336 | 0 | 0 | 0 | 0 | 0 | 0 | 116 | 0.128035 |
e908268a83f96abbf4d4753eae66db6c612a092e | 389 | py | Python | sglib/__init__.py | mvinyard/guideID | fec14c8713960428fc31f68ece7ac36a7b2bcab9 | [
"MIT"
] | null | null | null | sglib/__init__.py | mvinyard/guideID | fec14c8713960428fc31f68ece7ac36a7b2bcab9 | [
"MIT"
] | null | null | null | sglib/__init__.py | mvinyard/guideID | fec14c8713960428fc31f68ece7ac36a7b2bcab9 | [
"MIT"
] | null | null | null | # __init__.py
from ._sgRNA_Library import _sgRNA_Library as Library
# functions
from ._gene_annotation_functions._merge_reduce_gene_regions import _merge_reduce_gene_regions as merge_reduce
from ._guide_annotation_functions._annotate_biochemistry import _annotate_biochemistry as annotate_biochemistry, _annotate_GC_c... | 43.222222 | 195 | 0.894602 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 24 | 0.061697 |
e90a508ef0e30d0bdd4948ae4a031308ac6c728e | 10,317 | py | Python | pag_demo.py | Topaz1618/MeowFile | 33878abfb552128368ad6bbf5396d45f21906ce3 | [
"MIT"
] | null | null | null | pag_demo.py | Topaz1618/MeowFile | 33878abfb552128368ad6bbf5396d45f21906ce3 | [
"MIT"
] | null | null | null | pag_demo.py | Topaz1618/MeowFile | 33878abfb552128368ad6bbf5396d45f21906ce3 | [
"MIT"
] | null | null | null | __copyright__ = """ Copyright (c) 2021 HangYan. """
__license__ = 'MIT license'
__version__ = '1.0'
__author__ = 'topaz1668@gmail.com'
from models import conn_db, UploadFiles
from sqlalchemy import func, distinct, or_, and_
import datetime
from datetime import timedelta
import time
import math
def string_to_ts(str_t... | 29.226629 | 342 | 0.602113 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8,574 | 0.829608 |
e90aae947ee6b59303ae1471afa7007b7d9e535a | 4,490 | py | Python | test/orb.py | Tythos/oyb | 0653c4fa24c73f4f2cb2d1c1a29d318f6e9cbd79 | [
"MIT"
] | 1 | 2017-08-05T16:16:32.000Z | 2017-08-05T16:16:32.000Z | test/orb.py | Tythos/oyb | 0653c4fa24c73f4f2cb2d1c1a29d318f6e9cbd79 | [
"MIT"
] | null | null | null | test/orb.py | Tythos/oyb | 0653c4fa24c73f4f2cb2d1c1a29d318f6e9cbd79 | [
"MIT"
] | null | null | null | """
"""
import datetime
import unittest
import numpy
from math import pi
import oyb
from oyb import earth, anomaly
class ClassTests(unittest.TestCase):
def test_default(self):
o = oyb.Orbit()
def test_args(self):
o = oyb.Orbit(a_m=1.064e7, e=0.42607, i_rad=39.687*pi/180, O_rad=130.32*... | 38.376068 | 122 | 0.57951 | 4,294 | 0.956347 | 0 | 0 | 0 | 0 | 0 | 0 | 17 | 0.003786 |
e90be1f05a4443793696e6d766c9b0e422e47832 | 11,656 | py | Python | src/python/WMComponent/JobArchiver/JobArchiverPoller.py | hufnagel/WMCore | b150cc725b68fc1cf8e6e0fa07c826226a4421fa | [
"Apache-2.0"
] | 1 | 2015-02-05T13:43:46.000Z | 2015-02-05T13:43:46.000Z | src/python/WMComponent/JobArchiver/JobArchiverPoller.py | hufnagel/WMCore | b150cc725b68fc1cf8e6e0fa07c826226a4421fa | [
"Apache-2.0"
] | 1 | 2016-10-13T14:57:35.000Z | 2016-10-13T14:57:35.000Z | src/python/WMComponent/JobArchiver/JobArchiverPoller.py | hufnagel/WMCore | b150cc725b68fc1cf8e6e0fa07c826226a4421fa | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
The actual jobArchiver algorithm
"""
import logging
import os
import os.path
import shutil
import tarfile
import threading
from Utils.IteratorTools import grouper
from Utils.Timers import timeFunction
from WMCore.DAOFactory import DAOFactory
from WMCore.JobStateMachine.ChangeState import Chan... | 34.081871 | 99 | 0.591455 | 10,943 | 0.93883 | 0 | 0 | 1,058 | 0.090769 | 0 | 0 | 3,048 | 0.261496 |
e90c4cbbc181386f952de337a177c966ed5084da | 1,795 | py | Python | src/aqm/run_create_views.py | layadelcarmen/aqm | ee300b0064b78d73e2020c1e50300e65a7fb727e | [
"MIT"
] | null | null | null | src/aqm/run_create_views.py | layadelcarmen/aqm | ee300b0064b78d73e2020c1e50300e65a7fb727e | [
"MIT"
] | null | null | null | src/aqm/run_create_views.py | layadelcarmen/aqm | ee300b0064b78d73e2020c1e50300e65a7fb727e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
import psycopg2
def executeScriptsFromFile(filename, cursor):
'''Execute SQL create views'''
fd = open(filename, 'r')
sqlFile = fd.read()
fd.close()
sqlCommands = sqlFile.split(';')
for command in sqlCommands:
try:
print(command)
... | 31.491228 | 196 | 0.494708 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 335 | 0.18663 |
e90c9d97a14172ce328d8d9a5973b099b111668f | 5,127 | py | Python | mnist/mnist_dist.py | vibhatha/PytorchExamples | df356f120d6eef69a94586af93bff75af307582d | [
"Apache-2.0"
] | 3 | 2021-04-11T05:09:00.000Z | 2021-08-11T09:58:53.000Z | mnist/mnist_dist.py | vibhatha/PytorchExamples | df356f120d6eef69a94586af93bff75af307582d | [
"Apache-2.0"
] | 4 | 2021-03-12T21:51:01.000Z | 2021-03-14T16:03:13.000Z | mnist/mnist_dist.py | vibhatha/PytorchExamples | df356f120d6eef69a94586af93bff75af307582d | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import argparse
from math import ceil
from random import Random
from socket import socket
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.optim.lr_scheduler import StepLR
import... | 29.635838 | 122 | 0.577921 | 1,531 | 0.298615 | 0 | 0 | 0 | 0 | 0 | 0 | 682 | 0.133021 |
e90e71723fb83c3e9db45cf94c16cac0b3962eb2 | 1,218 | py | Python | common/es/one_scripts.py | ltxhh/course | 45c8e4e436d9f20effccc7ed0844dfd07d8348b1 | [
"Apache-2.0"
] | null | null | null | common/es/one_scripts.py | ltxhh/course | 45c8e4e436d9f20effccc7ed0844dfd07d8348b1 | [
"Apache-2.0"
] | null | null | null | common/es/one_scripts.py | ltxhh/course | 45c8e4e436d9f20effccc7ed0844dfd07d8348b1 | [
"Apache-2.0"
] | null | null | null | # -*- codeing = utf-8 -*-
# @Time : 2022/4/12 13:43
# @Author : linyaxuan
# @File : one_scripts.py
# @Software : PyCharm
"""
将数据库数据导入es
"""
import pymysql
import traceback
from elasticsearch import Elasticsearch
def get_db_data():
# 打开数据库连接(ip/数据库用户名/登录密码/数据库名)
db = pymysql.connect(host="127.0.0.1:3306", use... | 23.882353 | 85 | 0.559113 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 547 | 0.405185 |
e90efb1a09f98ac8736cd0e451c9792361d21cef | 1,048 | py | Python | core/services/tests.py | ojengwa/reportr | ca66184e2b7f28cb3818bb5d3a931232566bff99 | [
"MIT"
] | 2 | 2015-01-26T14:43:20.000Z | 2015-02-13T10:18:44.000Z | core/services/tests.py | ojengwa/reportr | ca66184e2b7f28cb3818bb5d3a931232566bff99 | [
"MIT"
] | null | null | null | core/services/tests.py | ojengwa/reportr | ca66184e2b7f28cb3818bb5d3a931232566bff99 | [
"MIT"
] | null | null | null | from django.test import TestCase
from core.services.freckle import Freckle
from datetime import datetime
class TestServices(TestCase):
"""docstring for TestServices"""
def setUp(self):
self.client = Freckle('8zh8ny1wlym4ljyi68p0je410s1aj8b', 'andela')
self.users = self.client.get_users()
... | 32.75 | 87 | 0.69084 | 940 | 0.896947 | 0 | 0 | 0 | 0 | 0 | 0 | 182 | 0.173664 |
e910c8bb7a93d643dfe5883064380eb1ced0913d | 1,343 | py | Python | doubleRedirect.py | ebraminio/DeltaBot | 14d427ca644c4e842f72802a0e07adcaecda7097 | [
"CC0-1.0"
] | 10 | 2016-08-09T21:28:27.000Z | 2021-12-23T17:22:04.000Z | doubleRedirect.py | ebraminio/DeltaBot | 14d427ca644c4e842f72802a0e07adcaecda7097 | [
"CC0-1.0"
] | 9 | 2016-12-31T10:48:11.000Z | 2020-07-22T20:52:06.000Z | doubleRedirect.py | ebraminio/DeltaBot | 14d427ca644c4e842f72802a0e07adcaecda7097 | [
"CC0-1.0"
] | 11 | 2017-01-24T15:51:57.000Z | 2022-02-10T00:35:18.000Z | #!/usr/bin/python
# -*- coding: UTF-8 -*-
# licensed under CC-Zero: https://creativecommons.org/publicdomain/zero/1.0
import pywikibot
from pywikibot.data import api
import re
site = pywikibot.Site('wikidata', 'wikidata')
site.login()
repo = site.data_repository()
def redirect(fromId, toId):
# get... | 24.87037 | 78 | 0.527923 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 392 | 0.291884 |
e910d43c7dfc7b7187050331c0e77e2a387d6e5f | 271 | py | Python | Dataset/Leetcode/train/66/44.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/train/66/44.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/train/66/44.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | class Solution:
def XXX(self, digits: List[int]) -> List[int]:
num = 0
ss = []
for i in range(len(digits)):
num += digits[i]*(pow(10,len(digits)-i-1))
for i in str(num+1):
ss.append(int(i))
return ss
| 24.636364 | 54 | 0.472325 | 268 | 0.98893 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e912162e98a071826f62ad98af891120325dbaa8 | 2,327 | py | Python | lab1/domanda3.py | D33pBlue/Algoritmi | 76088f40b49d51416919515a274ba076ae6a197e | [
"MIT"
] | null | null | null | lab1/domanda3.py | D33pBlue/Algoritmi | 76088f40b49d51416919515a274ba076ae6a197e | [
"MIT"
] | 1 | 2018-03-17T19:15:41.000Z | 2018-03-17T19:18:24.000Z | lab1/domanda3.py | D33pBlue/Algoritmi | 76088f40b49d51416919515a274ba076ae6a197e | [
"MIT"
] | null | null | null | from domanda1 import *
import random
import time
class DPATrial:
def __init__(self,m):
self.numNodes = m
self.nodeNumbers = list()
for i in range(m):
for _ in range(m):
self.nodeNumbers.append(i)
def runTrial(self,m):
V = []
random.shuffle(s... | 25.855556 | 73 | 0.588311 | 538 | 0.231199 | 0 | 0 | 0 | 0 | 0 | 0 | 462 | 0.198539 |
e914dc16d8c9fee0bbb11e912b41acdddd08ad05 | 1,237 | py | Python | leetcode/permutation.py | huynonstop/solving-everything | 21c7c32f9e482e1e88d5ec8a03f8815d28f7ef39 | [
"MIT"
] | null | null | null | leetcode/permutation.py | huynonstop/solving-everything | 21c7c32f9e482e1e88d5ec8a03f8815d28f7ef39 | [
"MIT"
] | null | null | null | leetcode/permutation.py | huynonstop/solving-everything | 21c7c32f9e482e1e88d5ec8a03f8815d28f7ef39 | [
"MIT"
] | null | null | null | from typing import List
class Solution:
def permuteUnique(self, nums: List[int]) -> List[List[int]]:
return permute_unique(nums)
# https://leetcode.com/problems/permutations-ii/discuss/18602/9-line-python-solution-with-1-line-to-handle-duplication-beat-99-of-others-%3A-)
def permute_unique(nums):
r... | 22.089286 | 142 | 0.501213 | 116 | 0.093775 | 0 | 0 | 0 | 0 | 0 | 0 | 142 | 0.114794 |
e91854ceacf0d5585096c1554b24da88785c0f89 | 14,051 | py | Python | labtoys/Tektronix/MSO5x.py | ppudo/labtoys_python | c8ca27637602b8aac0574e92da370a4a97e9fcad | [
"MIT"
] | null | null | null | labtoys/Tektronix/MSO5x.py | ppudo/labtoys_python | c8ca27637602b8aac0574e92da370a4a97e9fcad | [
"MIT"
] | null | null | null | labtoys/Tektronix/MSO5x.py | ppudo/labtoys_python | c8ca27637602b8aac0574e92da370a4a97e9fcad | [
"MIT"
] | null | null | null | #MSO5x.py
# Created on: 2020.11.18
# Author: ppudo
# e-mail: ppudo@outlook.com
#
# Project: labtoys
# Description: Class representing Tektronix MSO5 osciloscope series
#
#
# Changelog:
# -2021.11.18 version: 0.1.0
# - Initial class
#
#------------------------------------------------... | 50.725632 | 153 | 0.38951 | 13,322 | 0.948118 | 0 | 0 | 456 | 0.032453 | 0 | 0 | 5,741 | 0.408583 |
e91d0411a8febadb09ca20268e15414ccded8163 | 1,543 | py | Python | pedurma/proofreading.py | Esukhia/pedurma | 334b5957db30f514d396bd9defc9e9381f5b290b | [
"MIT"
] | null | null | null | pedurma/proofreading.py | Esukhia/pedurma | 334b5957db30f514d396bd9defc9e9381f5b290b | [
"MIT"
] | null | null | null | pedurma/proofreading.py | Esukhia/pedurma | 334b5957db30f514d396bd9defc9e9381f5b290b | [
"MIT"
] | 1 | 2021-11-04T07:04:05.000Z | 2021-11-04T07:04:05.000Z | from pedurma.pecha import ProofreadNotePage
from pedurma.utils import from_yaml
def get_note_page_img_link(text_id, pg_num, repo_path):
text_meta = from_yaml((repo_path / text_id / "meta.yml"))
image_grp_id = text_meta.get("img_grp_id", "")
img_link = f"https://iiif.bdrc.io/bdr:{image_grp_id}::{image_grp_... | 35.068182 | 116 | 0.706416 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 297 | 0.192482 |
e91e11b03c50d75698f208a10f1b310af5a8ffcc | 4,043 | py | Python | authors/apps/articles/tests/test_likes_dislikes.py | andela/ah-backend-prime | 0708463d4565a4977a5a5dcb839f1dfed52fdc90 | [
"BSD-3-Clause"
] | 1 | 2019-09-19T14:30:05.000Z | 2019-09-19T14:30:05.000Z | authors/apps/articles/tests/test_likes_dislikes.py | e-ian/authors-haven-frontend | 05829c8088ca49ef2cf0863dc87ec55b44b13534 | [
"BSD-3-Clause"
] | 22 | 2019-03-25T16:10:53.000Z | 2022-03-11T23:44:21.000Z | authors/apps/articles/tests/test_likes_dislikes.py | e-ian/authors-haven-frontend | 05829c8088ca49ef2cf0863dc87ec55b44b13534 | [
"BSD-3-Clause"
] | 6 | 2019-03-25T09:39:39.000Z | 2021-03-11T23:54:12.000Z | import json
from rest_framework import status, response
from django.urls import reverse
from .base import ArticlesBaseTest
from .test_data import VALID_ARTICLE
from authors.apps.authentication.tests.test_data import (
VALID_USER_DATA
)
from rest_framework.test import APIClient, APITestCase
from .base import BaseTes... | 33.97479 | 71 | 0.623547 | 3,717 | 0.919367 | 0 | 0 | 0 | 0 | 0 | 0 | 716 | 0.177096 |
e91ff99a3728e01c9518fdfe79d256b14ae28af1 | 353 | py | Python | DataBase Sqlite3/NoteMeilheur.py | otmanabdoun/IHM-Python | 624e961c2f6966b98bf2c1bc4dd276b812954ba1 | [
"Apache-2.0"
] | 3 | 2021-12-08T10:34:55.000Z | 2022-01-17T21:02:40.000Z | NoteMeilheur.py | otmanabdoun/IHM-Python | 624e961c2f6966b98bf2c1bc4dd276b812954ba1 | [
"Apache-2.0"
] | null | null | null | NoteMeilheur.py | otmanabdoun/IHM-Python | 624e961c2f6966b98bf2c1bc4dd276b812954ba1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Nov 3 04:38:07 2021
@author: User
"""
import sqlite3
connexion = sqlite3.connect("dbM2IQL.db")
curseur = connexion.cursor()
curseur.execute("""SELECT e.Nom, c.note FROM Etudiant as e INNER JOIN
CF as c ON e.id = c.fk_etudiant
ORDER BY c.note DESC LIMIT ... | 25.214286 | 70 | 0.651558 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 225 | 0.637394 |
e921b1bc0cceec8b113f393fdb06b057357e8848 | 24,410 | py | Python | packages/robotframework-test-assistant/robotframework-test-assistant.py | jg8481/leon | b94a6c753cee79f4568ab7a83932351f7c949791 | [
"MIT"
] | 3 | 2020-01-15T20:49:42.000Z | 2020-11-22T01:41:33.000Z | packages/robotframework-test-assistant/robotframework-test-assistant.py | jg8481/leon | b94a6c753cee79f4568ab7a83932351f7c949791 | [
"MIT"
] | null | null | null | packages/robotframework-test-assistant/robotframework-test-assistant.py | jg8481/leon | b94a6c753cee79f4568ab7a83932351f7c949791 | [
"MIT"
] | 3 | 2020-01-18T17:06:56.000Z | 2020-12-16T16:03:57.000Z | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
import utils
import os
import os.path
import sys
import subprocess
import re
import time
filepath = os.path.dirname(os.path.realpath(__file__))
small_time_delay = 5 ##--> Use this to set up your small time delay. This time delay is in seconds.
medium_time_delay = 20 ##--... | 70.549133 | 292 | 0.7712 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 13,737 | 0.562761 |
e9225ac8234cba226c9c33772de98e2d065d77b6 | 349 | py | Python | chapter2/bandit.py | mtrazzi/understanding-rl | 83a9b7608c805189a39b4ef81893f6ebe982f9e1 | [
"MIT"
] | 95 | 2020-04-26T12:36:07.000Z | 2020-05-02T13:23:47.000Z | chapter2/bandit.py | 3outeille/rl-book-challenge | b02595b0aec3e9632ef5d9814e925384931089bd | [
"MIT"
] | 2 | 2020-09-24T20:29:29.000Z | 2021-11-27T11:17:45.000Z | chapter2/bandit.py | 3outeille/rl-book-challenge | b02595b0aec3e9632ef5d9814e925384931089bd | [
"MIT"
] | 15 | 2020-04-27T04:10:02.000Z | 2020-04-30T21:42:04.000Z | import numpy as np
class Bandit:
def __init__(self, k=10, mean=0):
self.k = k
self.q = np.random.randn(k) + mean
self.old_q = [q_val for q_val in self.q] # copy
def max_action(self):
return np.argmax(self.q)
def reward(self, action):
return np.random.normal(self.q[action])
def reset(se... | 19.388889 | 52 | 0.638968 | 327 | 0.936963 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 0.017192 |
e92450a33cbfd0332cf6d8991a025ba1f22e0f12 | 1,765 | py | Python | Sublime_Plugin/EditFormat.py | dtysky/Gal2Renpy | 59a70c5d336394155dedaf82d17bd99297f92d1a | [
"MIT"
] | 36 | 2015-04-19T05:03:10.000Z | 2022-03-29T08:12:38.000Z | Sublime_Plugin/EditFormat.py | dtysky/Gal2Renpy | 59a70c5d336394155dedaf82d17bd99297f92d1a | [
"MIT"
] | 2 | 2016-05-05T07:24:09.000Z | 2017-11-01T05:32:11.000Z | Sublime_Plugin/EditFormat.py | dtysky/Gal2Renpy | 59a70c5d336394155dedaf82d17bd99297f92d1a | [
"MIT"
] | 2 | 2016-12-01T02:12:33.000Z | 2020-03-09T02:27:19.000Z | #coding:utf-8
#########################
#Copyright(c) 2014 dtysky
#########################
def EditFormat(US,UT):
tmp={
'sc':[
0,('k'),{'k':'None'},
('cp','sc'),{'cp':'None','sc':'None'}
],
'sw':[
0,(),{},
('s',),{'s':'None'}
],
'chrlast':[
1,('l','t'),{'l':'None','t':'None'}... | 19.611111 | 82 | 0.273088 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 820 | 0.464589 |
e924c56b0295f7f4a6d78dab18bd9428b1fe0209 | 272 | py | Python | wesgame.py | WestenPy/Curso_em_video | 9f6a9775d27e1b86d54b381aba5da69b2ae21b27 | [
"MIT"
] | null | null | null | wesgame.py | WestenPy/Curso_em_video | 9f6a9775d27e1b86d54b381aba5da69b2ae21b27 | [
"MIT"
] | null | null | null | wesgame.py | WestenPy/Curso_em_video | 9f6a9775d27e1b86d54b381aba5da69b2ae21b27 | [
"MIT"
] | null | null | null | from random import randint
def ataque():
r = randint(1, 20)
if r >= 18:
print('DANO CRÍTICO!')
elif r >= 8 or r < 18:
print('DANO NORMAL!')
elif r >= 3 or r < 8:
print('DANO REDUZIDO!')
else:
print('ERRO!')
ataque()
| 16 | 31 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 53 | 0.194139 |
e924f0db03f4f2a8c126f7c109a518852a2aa24a | 6,850 | py | Python | ProcessingData/get_gp-bias.py | gomes-lab/SARA_ScienceAdvances | 61848d1c92a66bd58c8c195e5b2bb250ef8efb51 | [
"MIT"
] | 1 | 2022-01-13T12:17:29.000Z | 2022-01-13T12:17:29.000Z | ProcessingData/get_gp-bias.py | gomes-lab/SARA_ScienceAdvances | 61848d1c92a66bd58c8c195e5b2bb250ef8efb51 | [
"MIT"
] | null | null | null | ProcessingData/get_gp-bias.py | gomes-lab/SARA_ScienceAdvances | 61848d1c92a66bd58c8c195e5b2bb250ef8efb51 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Script to extract the gp bias features from microscopy images
"""
import sys
import json
import os
import copy as cp
import numpy as np
import glob
import matplotlib.pyplot as plt
import matplotlib
from numpy.polynomial import polynomial
import offsets as GS
from probability_dist import *
imp... | 35.492228 | 163 | 0.646277 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,495 | 0.218184 |
e925522b3d3915457215980e5bca266c8fd2ff38 | 2,448 | py | Python | monitoring/automation/monitor.py | shane0/flask-website-monitor | 39031b9207c97baef4b10a792e038f241bcdc857 | [
"MIT"
] | 1 | 2017-04-13T05:29:15.000Z | 2017-04-13T05:29:15.000Z | monitoring/automation/monitor.py | shane0/flask-website-monitor | 39031b9207c97baef4b10a792e038f241bcdc857 | [
"MIT"
] | 1 | 2017-04-12T23:44:58.000Z | 2017-04-12T23:44:58.000Z | monitoring/automation/monitor.py | shane0/flask-website-monitor | 39031b9207c97baef4b10a792e038f241bcdc857 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
A website monitor.
"""
import sys
import traceback
import requests
import re
import json
import datetime
DEFAULT_CONFIG_FILE = 'config.json'
def check():
headers = {
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'... | 28.137931 | 126 | 0.541258 | 579 | 0.23652 | 0 | 0 | 0 | 0 | 0 | 0 | 1,000 | 0.408497 |
e9268aab7efb78626ab35cbb0daf3f9adf12bcb0 | 253 | py | Python | tests/test_MicropythonBoards.py | dwighthubbard/micropython-cloudmanager | 1b41eeaf7f5a34a622826bf0030a9f5c45d1aefc | [
"MIT"
] | 1 | 2017-02-22T03:18:48.000Z | 2017-02-22T03:18:48.000Z | tests/test_MicropythonBoards.py | dwighthubbard/micropython-cloudmanager | 1b41eeaf7f5a34a622826bf0030a9f5c45d1aefc | [
"MIT"
] | null | null | null | tests/test_MicropythonBoards.py | dwighthubbard/micropython-cloudmanager | 1b41eeaf7f5a34a622826bf0030a9f5c45d1aefc | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
import sys
sys.path.insert(0, '.')
from cloudmanager.board import MicropythonBoards
for result in MicropythonBoards().execute("import os;print(os.uname())"):
print(result.read().strip())
| 25.3 | 73 | 0.754941 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 53 | 0.209486 |
e92912ace35fc868f85b6a3bdb13260570590334 | 412 | py | Python | Chapter03/c3_27_datadotworld_1.py | andrewjcoxon/Hands-On-Data-Science-with-Anaconda | 82504a059ecd284b3599fa9af2b3eb6bbd6e28f3 | [
"MIT"
] | 25 | 2018-06-25T16:21:09.000Z | 2022-02-08T09:28:29.000Z | Hands-On-Data-Science-with-Anaconda-master/Hands-On-Data-Science-with-Anaconda-master/Chapter03/c3_27_datadotworld_1.py | manual123/Nacho-Jupyter-Notebooks | e75523434b1a90313a6b44e32b056f63de8a7135 | [
"MIT"
] | null | null | null | Hands-On-Data-Science-with-Anaconda-master/Hands-On-Data-Science-with-Anaconda-master/Chapter03/c3_27_datadotworld_1.py | manual123/Nacho-Jupyter-Notebooks | e75523434b1a90313a6b44e32b056f63de8a7135 | [
"MIT"
] | 17 | 2018-06-15T02:55:30.000Z | 2022-03-09T15:24:42.000Z | """
Name : c3_27_datadotworld_1.py
Book : Hands-on Data Science with Anaconda)
Publisher: Packt Publishing Ltd.
Author : Yuxing Yan and James Yan
Date : 1/15/2018
email : yany@canisius.edu
paulyxy@hotmail.com
"""
import datadotworld as dw
dataset = 'jonloyens/an-intro-to-dat... | 27.466667 | 51 | 0.694175 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 296 | 0.718447 |
e92a3ce5abab1bfe02516472d0fc6c56a482d48d | 15,964 | py | Python | strutil.py | IloveKanade/k3fmt | 13a81562b9fc706dbf7fc05fcae130260bc2551d | [
"MIT"
] | null | null | null | strutil.py | IloveKanade/k3fmt | 13a81562b9fc706dbf7fc05fcae130260bc2551d | [
"MIT"
] | 3 | 2021-08-06T07:24:40.000Z | 2022-03-23T06:58:36.000Z | strutil.py | IloveKanade/k3fmt | 13a81562b9fc706dbf7fc05fcae130260bc2551d | [
"MIT"
] | 1 | 2021-08-04T08:41:33.000Z | 2021-08-04T08:41:33.000Z | import re
import os
import errno
import string
import subprocess
import k3color
listtype = (tuple, list)
invisible_chars = ''.join(map(chr, list(range(0, 32))))
invisible_chars_re = re.compile('[%s]' % re.escape(invisible_chars))
def break_line(linestr, width):
lines = linestr.splitlines()
rst = []
spa... | 26.084967 | 103 | 0.5057 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6,018 | 0.376973 |
e92ba6f82fbd7b5de0f238a51cd87521f2ccd146 | 16,920 | py | Python | camera.py | Euclideon/udSDKPython | a82157ab6382fda6291bdcca9ec2a51203b95b2a | [
"MIT"
] | 4 | 2020-09-03T05:35:15.000Z | 2021-11-08T04:31:55.000Z | camera.py | Euclideon/udSDKPython | a82157ab6382fda6291bdcca9ec2a51203b95b2a | [
"MIT"
] | 1 | 2020-08-18T06:49:21.000Z | 2020-08-18T06:49:21.000Z | camera.py | Euclideon/udSDKPython | a82157ab6382fda6291bdcca9ec2a51203b95b2a | [
"MIT"
] | 1 | 2020-09-11T07:52:32.000Z | 2020-09-11T07:52:32.000Z | import logging
import math
import numpy as np
import pyglet
import udSDK
logger = logging.getLogger(__name__)
class Camera():
"""
Base camera class for Euclideon udSDK Python Sample
This sets the default behaviour for a perspective camera
Stores the state of the camera, and provides functions for modifyting
... | 29.32409 | 176 | 0.642317 | 16,790 | 0.992317 | 0 | 0 | 270 | 0.015957 | 0 | 0 | 4,322 | 0.255437 |
e930d65f391b7723982c2721df59191c1d9d3a9f | 316 | py | Python | src/menu.py | simonenicf/Escape-from-Narlilia | cd512860e74d5df81504cccbcb667fdf794c8dda | [
"MIT"
] | null | null | null | src/menu.py | simonenicf/Escape-from-Narlilia | cd512860e74d5df81504cccbcb667fdf794c8dda | [
"MIT"
] | 1 | 2020-11-03T13:41:49.000Z | 2020-11-03T14:05:22.000Z | src/menu.py | simonenicf/Escape-from-Narlilia | cd512860e74d5df81504cccbcb667fdf794c8dda | [
"MIT"
] | null | null | null | import sys
class Menu():
@staticmethod
def print_menu():
print (30 * "-" , "Text based adventure" , 30 * "-")
print ("1. start adventure (intro)")
print ("2. start adventure (no intro)")
print ("3. help")
print ("4. quit")
print (67 * "-")
print(" ")
| 24.307692 | 60 | 0.487342 | 303 | 0.958861 | 0 | 0 | 285 | 0.901899 | 0 | 0 | 111 | 0.351266 |
e9321bfef23bb209db9bf3ff382e024a2aab02ee | 337 | py | Python | envipyarclib/gptool/parameter/templates/ulong64array.py | envi-idl/envipyarclib | 90135652510c3d53c5f51177252c1fea2639bf22 | [
"MIT"
] | 1 | 2019-08-03T05:10:18.000Z | 2019-08-03T05:10:18.000Z | envipyarclib/gptool/parameter/templates/ulong64array.py | envi-idl/envipyarclib | 90135652510c3d53c5f51177252c1fea2639bf22 | [
"MIT"
] | null | null | null | envipyarclib/gptool/parameter/templates/ulong64array.py | envi-idl/envipyarclib | 90135652510c3d53c5f51177252c1fea2639bf22 | [
"MIT"
] | 1 | 2020-02-25T14:12:50.000Z | 2020-02-25T14:12:50.000Z | """
Defines the parameter template for the specified data type.
"""
from .basicarray import BASICARRAY
class ULONG64ARRAY(BASICARRAY):
"""
Defines the parameter template for the specified data type.
"""
pass
def template():
"""Factory method for this parameter template class"""
return ULONG6... | 19.823529 | 63 | 0.706231 | 120 | 0.356083 | 0 | 0 | 0 | 0 | 0 | 0 | 204 | 0.605341 |
e9324103dd727dbfbcd73f1ba4bae58a0ea2e051 | 41,336 | py | Python | Dataflow/full_executer_wordshop.py | Smurf-maker/WordShop | ac0095ee28207f23744337d4cb35c5ca764d7e26 | [
"MIT"
] | null | null | null | Dataflow/full_executer_wordshop.py | Smurf-maker/WordShop | ac0095ee28207f23744337d4cb35c5ca764d7e26 | [
"MIT"
] | null | null | null | Dataflow/full_executer_wordshop.py | Smurf-maker/WordShop | ac0095ee28207f23744337d4cb35c5ca764d7e26 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Full Executer WordShop.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1kGSQWNtImJknauUN9L8ZRRwIzAdwbmo_
First, we load the pegasus paraphraser.
"""
# Commented out IPython magic to ensure Python compatibility.
!git cl... | 42.483042 | 230 | 0.682287 | 28,604 | 0.691921 | 0 | 0 | 0 | 0 | 0 | 0 | 16,674 | 0.403338 |
e932fb4ec343373146508adfa905b3c8915cb66b | 4,831 | py | Python | train.py | ppujol76/-Pere_Transformers | e267bcc6559c998accaed647cacbff253031f8b0 | [
"MIT"
] | null | null | null | train.py | ppujol76/-Pere_Transformers | e267bcc6559c998accaed647cacbff253031f8b0 | [
"MIT"
] | null | null | null | train.py | ppujol76/-Pere_Transformers | e267bcc6559c998accaed647cacbff253031f8b0 | [
"MIT"
] | 1 | 2021-06-21T08:40:18.000Z | 2021-06-21T08:40:18.000Z | import torch
import os
from model.visualization import Visualization
from panel.main import tensorboard_panel
from torch.utils.data.dataset import Subset
import random
import numpy as np
def write_on_tensorboard(epoch:int, loss:int, bleu:int, image, expected_captions, generated_captions):
tensorboard_panel.add_senten... | 35.262774 | 114 | 0.673981 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,513 | 0.312991 |
e933799d41eabf2ce3d0578ad558fcf9ab8d220d | 2,251 | py | Python | views/probabilidade.py | pxcx/ambar-backend | 350baabb492e4fbc1002ea851d1cef4fc999b81a | [
"MIT"
] | null | null | null | views/probabilidade.py | pxcx/ambar-backend | 350baabb492e4fbc1002ea851d1cef4fc999b81a | [
"MIT"
] | null | null | null | views/probabilidade.py | pxcx/ambar-backend | 350baabb492e4fbc1002ea851d1cef4fc999b81a | [
"MIT"
] | null | null | null | from flask import jsonify
from sqlalchemy import func
from datetime import datetime, date
from models.previsao import Previsao, db
def configure(app):
# /probabilidade - retorna a probabilidade total de chuva
# - inicio (YYYY-MM-DD)
# - fim (YYYY-MM-DD)
@app.route('/probabilidade/<inicio>/<fim>', metho... | 39.491228 | 97 | 0.52821 | 0 | 0 | 0 | 0 | 1,922 | 0.853085 | 0 | 0 | 384 | 0.170439 |
e937f0e5ec885071b7daceb7fa5456d999a1e95f | 293 | py | Python | scripts/makeNegativesList.py | jccaicedo/localization-agent | d280acf355307b74e68dca9ec80ab293f0d18642 | [
"MIT"
] | 8 | 2016-11-20T19:43:45.000Z | 2020-12-09T04:58:05.000Z | scripts/makeNegativesList.py | jccaicedo/localization-agent | d280acf355307b74e68dca9ec80ab293f0d18642 | [
"MIT"
] | 45 | 2015-05-04T20:41:05.000Z | 2017-07-17T12:04:13.000Z | scripts/makeNegativesList.py | jccaicedo/localization-agent | d280acf355307b74e68dca9ec80ab293f0d18642 | [
"MIT"
] | 9 | 2016-11-20T19:43:46.000Z | 2020-09-01T21:01:54.000Z | import sys,os
import utils as cu
params = cu.loadParams('fullList positivesList output')
full = [x for x in open(params['fullList'])]
positives = [x for x in open(params['positivesList'])]
out = open(params['output'],'w')
for r in full:
if r not in positives:
out.write(r)
out.close()
| 22.538462 | 55 | 0.692833 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 67 | 0.228669 |
e93a77efc359563f0911c10f45a8c7e3f5ed8fd4 | 1,354 | py | Python | tests/test_model.py | alexdawn/rollinghub | 6043c12520d7e0b0596f28c166616c1014e1f870 | [
"MIT"
] | null | null | null | tests/test_model.py | alexdawn/rollinghub | 6043c12520d7e0b0596f28c166616c1014e1f870 | [
"MIT"
] | 11 | 2019-08-18T21:37:28.000Z | 2022-03-21T22:17:37.000Z | tests/test_model.py | alexdawn/rollinghub | 6043c12520d7e0b0596f28c166616c1014e1f870 | [
"MIT"
] | null | null | null | import pytest
from rollinghub.db import get_db
def test_index(client, auth):
response = client.get('/')
assert b"Log In" in response.data
assert b"Register" in response.data
auth.login()
response = client.get('/')
assert b'Log Out' in response.data
assert b'test title' in response.data
... | 27.08 | 72 | 0.656573 | 0 | 0 | 0 | 0 | 413 | 0.305022 | 0 | 0 | 410 | 0.302806 |
e93be486b0635edc83619c16da55bfa370ed7c0e | 19,672 | py | Python | openpype/hosts/unreal/plugins/load/load_camera.py | Tilix4/OpenPype | 8909bd890170880aa7ec8b673abaa25a9bdf40f2 | [
"MIT"
] | 1 | 2022-02-08T15:40:41.000Z | 2022-02-08T15:40:41.000Z | openpype/hosts/unreal/plugins/load/load_camera.py | zafrs/OpenPype | 4b8e7e1ed002fc55b31307efdea70b0feaed474f | [
"MIT"
] | null | null | null | openpype/hosts/unreal/plugins/load/load_camera.py | zafrs/OpenPype | 4b8e7e1ed002fc55b31307efdea70b0feaed474f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Load camera from FBX."""
from pathlib import Path
import unreal
from unreal import EditorAssetLibrary
from unreal import EditorLevelLibrary
from unreal import EditorLevelUtils
from openpype.pipeline import (
AVALON_CONTAINER_ID,
legacy_io,
)
from openpype.hosts.unreal.api import plu... | 35.509025 | 79 | 0.573861 | 19,279 | 0.980022 | 0 | 0 | 0 | 0 | 0 | 0 | 3,723 | 0.189254 |
e93d157cf7aab5c1bcb7bfeee8e1f4209c714ad6 | 2,862 | py | Python | recommander-lib/src/main.py | armendu/recommander-system | e2d13838237584cc5cc4de2f4ea2d63f9f3b8889 | [
"MIT"
] | 1 | 2021-04-29T04:15:13.000Z | 2021-04-29T04:15:13.000Z | recommander-lib/src/main.py | armendu/recommander-system | e2d13838237584cc5cc4de2f4ea2d63f9f3b8889 | [
"MIT"
] | null | null | null | recommander-lib/src/main.py | armendu/recommander-system | e2d13838237584cc5cc4de2f4ea2d63f9f3b8889 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Main application file
"""
__author__ = "Armend Ukehaxhaj"
__version__ = "1.0.0"
__license__ = "MIT"
from logzero import logger
import numpy as np
import pandas as pd
import csv
import pickle
from word2vec import word2vec
from preprocessor import preprocessor
import json
primary_data_filen... | 27.519231 | 74 | 0.615653 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,459 | 0.509783 |
e93d7534c6c036af381481b03aad9004f87feec7 | 27 | py | Python | tests/models/__init__.py | Stevenjin8/song2vec | 908de06881d0598dcd2869d89709a2d50654a7fe | [
"MIT"
] | null | null | null | tests/models/__init__.py | Stevenjin8/song2vec | 908de06881d0598dcd2869d89709a2d50654a7fe | [
"MIT"
] | null | null | null | tests/models/__init__.py | Stevenjin8/song2vec | 908de06881d0598dcd2869d89709a2d50654a7fe | [
"MIT"
] | null | null | null | """Tests for ML models."""
| 13.5 | 26 | 0.592593 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 26 | 0.962963 |
e93dd26357433b7e319a7cf157df9046ce5be7e6 | 2,378 | py | Python | spark_auto_mapper/data_types/datetime.py | gagan-chawla/SparkAutoMapper | 7b0aca2e4bece42b3229550f3f2fcc9607f79437 | [
"Apache-2.0"
] | null | null | null | spark_auto_mapper/data_types/datetime.py | gagan-chawla/SparkAutoMapper | 7b0aca2e4bece42b3229550f3f2fcc9607f79437 | [
"Apache-2.0"
] | null | null | null | spark_auto_mapper/data_types/datetime.py | gagan-chawla/SparkAutoMapper | 7b0aca2e4bece42b3229550f3f2fcc9607f79437 | [
"Apache-2.0"
] | null | null | null | from typing import Optional, List
from pyspark.sql import Column, DataFrame
from pyspark.sql.functions import coalesce, to_timestamp
from spark_auto_mapper.data_types.column import AutoMapperDataTypeColumn
from spark_auto_mapper.data_types.data_type_base import AutoMapperDataTypeBase
from spark_auto_mapper.data_types... | 38.983607 | 109 | 0.670311 | 1,855 | 0.780067 | 0 | 0 | 0 | 0 | 0 | 0 | 277 | 0.116484 |
e93e7a9f148352765158065775751a4ec95c81cf | 1,425 | py | Python | backend/registry/migrations/0002_auto_20220105_1336.py | mrmap-community/MrMap | 5dc05b7a5339b967047cd207755718f670a1d7cd | [
"MIT"
] | 10 | 2021-03-12T17:46:38.000Z | 2022-03-11T10:59:01.000Z | backend/registry/migrations/0002_auto_20220105_1336.py | mrmap-community/mrmap | 5dc05b7a5339b967047cd207755718f670a1d7cd | [
"MIT"
] | 214 | 2021-03-10T19:24:17.000Z | 2022-03-15T07:34:24.000Z | backend/registry/migrations/0002_auto_20220105_1336.py | mrmap-community/MrMap | 5dc05b7a5339b967047cd207755718f670a1d7cd | [
"MIT"
] | 9 | 2021-03-16T19:47:54.000Z | 2022-03-11T11:01:22.000Z | # Generated by Django 3.2.9 on 2022-01-05 12:36
from django.db import migrations, models
import django.db.models.manager
class Migration(migrations.Migration):
dependencies = [
('registry', '0001_initial'),
]
operations = [
migrations.AlterModelManagers(
name='webfeatureserv... | 36.538462 | 162 | 0.65193 | 1,300 | 0.912281 | 0 | 0 | 0 | 0 | 0 | 0 | 501 | 0.351579 |
e93e898e14d862c8186e0e63f6ce2ac5ff75423c | 15,524 | py | Python | relah.py | ttwj/ReLah | 8231636d4698001dc615848096a97ebd78ae2713 | [
"WTFPL"
] | 3 | 2020-01-31T08:22:49.000Z | 2021-01-10T20:02:37.000Z | relah.py | ttwj/ReLah | 8231636d4698001dc615848096a97ebd78ae2713 | [
"WTFPL"
] | null | null | null | relah.py | ttwj/ReLah | 8231636d4698001dc615848096a97ebd78ae2713 | [
"WTFPL"
] | null | null | null | # Python implementation of DBS PayLah!
# By ttwj - 2017
import base64
import random
import string
#remember to install pycryptodome!
import datetime
from Crypto.Cipher import AES, PKCS1_v1_5
from Crypto.PublicKey import RSA
import lxml.etree, json
from lxml import html
from pprint import pprint
from io import String... | 33.67462 | 987 | 0.626578 | 14,212 | 0.915486 | 291 | 0.018745 | 318 | 0.020484 | 0 | 0 | 6,308 | 0.406339 |
e93fa44d8c8e89fa596f6f1e1b5862803b660a31 | 13,090 | py | Python | st_dashboard.py | amirtaghavy/TDI-capstone-RedditTalks-vs-MarketAction | 62d6b754348ed7ae5d5ef4bd31eb2553a76c8892 | [
"MIT"
] | null | null | null | st_dashboard.py | amirtaghavy/TDI-capstone-RedditTalks-vs-MarketAction | 62d6b754348ed7ae5d5ef4bd31eb2553a76c8892 | [
"MIT"
] | null | null | null | st_dashboard.py | amirtaghavy/TDI-capstone-RedditTalks-vs-MarketAction | 62d6b754348ed7ae5d5ef4bd31eb2553a76c8892 | [
"MIT"
] | null | null | null | import streamlit as st
import dill
import pandas as pd
import plotly.express as px
from datetime import date
import statsmodels
with open('compiled-sentiment-history.pkd', 'rb') as f:
df_compiled = dill.load(f)
df_compiled.drop_duplicates(inplace=True)
dates = list({idx[1] for idx in df_compiled.ind... | 55.940171 | 504 | 0.58793 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8,537 | 0.650785 |
e940349493488e9c1525d630923a4b14c70fd2d8 | 745 | py | Python | hoofball/migrations/0002_comment.py | leo-holanda/Hoofball | ccf4399d33a6381acd2ff41efce3dbf0dca6a092 | [
"MIT"
] | 1 | 2021-07-30T10:05:43.000Z | 2021-07-30T10:05:43.000Z | hoofball/migrations/0002_comment.py | leo-holanda/Hoofball | ccf4399d33a6381acd2ff41efce3dbf0dca6a092 | [
"MIT"
] | null | null | null | hoofball/migrations/0002_comment.py | leo-holanda/Hoofball | ccf4399d33a6381acd2ff41efce3dbf0dca6a092 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-03-01 20:26
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('hoofball', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Comment',
fi... | 29.8 | 114 | 0.587919 | 623 | 0.836242 | 0 | 0 | 0 | 0 | 0 | 0 | 122 | 0.163758 |
e9417a482c1a501cccd1b38f496ec064d6eb9c78 | 627 | py | Python | clock/clock/lib.py | litheblas/blasrummet-rpi | 5300e61c0d0d93fd77cd489eb02165793453b99f | [
"MIT"
] | null | null | null | clock/clock/lib.py | litheblas/blasrummet-rpi | 5300e61c0d0d93fd77cd489eb02165793453b99f | [
"MIT"
] | null | null | null | clock/clock/lib.py | litheblas/blasrummet-rpi | 5300e61c0d0d93fd77cd489eb02165793453b99f | [
"MIT"
] | null | null | null | from __future__ import absolute_import, unicode_literals
import logging
from time import sleep
from datetime import datetime
from .settings import PULSE_DURATION
from .io import pull, release
logger = logging.getLogger(__name__)
def pulse():
logger.debug('Pulsing at {}'.format(datetime.now().time()))
pull()... | 24.115385 | 77 | 0.717703 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 154 | 0.245614 |
e9425f8008305f97cda9a9d9e3075c0d79dde033 | 38 | py | Python | CH_03_pythonic_syntax/T_17_mypy.py | mastering-python/code_2 | 441af8b67402c8216c482cca7c002e1d7f0f1baa | [
"MIT"
] | null | null | null | CH_03_pythonic_syntax/T_17_mypy.py | mastering-python/code_2 | 441af8b67402c8216c482cca7c002e1d7f0f1baa | [
"MIT"
] | null | null | null | CH_03_pythonic_syntax/T_17_mypy.py | mastering-python/code_2 | 441af8b67402c8216c482cca7c002e1d7f0f1baa | [
"MIT"
] | null | null | null | some_number: int
some_number = 'test'
| 12.666667 | 20 | 0.763158 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 0.157895 |
e9432f57bd7e613914b0ff79424dc9823a1f7a75 | 2,513 | py | Python | crowdgezwitscher/users/migrations/0004_auto_20170402_1358.py | Strassengezwitscher/Crowdgezwitscher | afdd433acb35c1a554ba79464b744975de065151 | [
"MIT"
] | 4 | 2016-07-22T07:20:31.000Z | 2016-11-13T18:13:34.000Z | crowdgezwitscher/users/migrations/0004_auto_20170402_1358.py | Strassengezwitscher/Strassengezwitscher | afdd433acb35c1a554ba79464b744975de065151 | [
"MIT"
] | 402 | 2016-04-26T08:38:17.000Z | 2022-03-11T23:26:49.000Z | crowdgezwitscher/users/migrations/0004_auto_20170402_1358.py | Strassengezwitscher/Crowdgezwitscher | afdd433acb35c1a554ba79464b744975de065151 | [
"MIT"
] | 1 | 2018-01-14T16:58:57.000Z | 2018-01-14T16:58:57.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-04-02 13:58
from django.db import migrations
def forwards_func(apps, schema_editor):
"""Grant permissions for TwitterAccount to admins and mods.
Includes creating a new view permission.
"""
# We can't import the models directly as they may be... | 36.955882 | 108 | 0.702746 | 245 | 0.097493 | 0 | 0 | 0 | 0 | 0 | 0 | 877 | 0.348985 |
e9451ca12bd25e2853456158cde9221357093674 | 544 | py | Python | solutions/python3/267.py | sm2774us/amazon_interview_prep_2021 | f580080e4a6b712b0b295bb429bf676eb15668de | [
"MIT"
] | 42 | 2020-08-02T07:03:49.000Z | 2022-03-26T07:50:15.000Z | solutions/python3/267.py | ajayv13/leetcode | de02576a9503be6054816b7444ccadcc0c31c59d | [
"MIT"
] | null | null | null | solutions/python3/267.py | ajayv13/leetcode | de02576a9503be6054816b7444ccadcc0c31c59d | [
"MIT"
] | 40 | 2020-02-08T02:50:24.000Z | 2022-03-26T15:38:10.000Z | class Solution:
def generatePalindromes(self, s):
cnt, n = collections.Counter(s), len(s) // 2
odd, s, q = [c for c in cnt if cnt[c] % 2], "".join(k * (cnt[k] // 2) for k in cnt), {"#" * n}
if len(odd) > 1: return []
for c in s:
new = set()
for w in q:
... | 41.846154 | 102 | 0.397059 | 544 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 0.014706 |
e945ff9db15d3f14ca3c606adc1612355944457e | 909 | py | Python | gallery/03_sp/plot_wavelets.py | RandallBalestriero/TheanoXLA | d8778c2eb3254b478cef4f45d934bf921e695619 | [
"Apache-2.0"
] | 67 | 2020-02-21T21:26:46.000Z | 2020-06-14T14:25:42.000Z | gallery/03_sp/plot_wavelets.py | RandallBalestriero/TheanoXLA | d8778c2eb3254b478cef4f45d934bf921e695619 | [
"Apache-2.0"
] | 8 | 2020-02-22T14:45:56.000Z | 2020-06-07T16:56:47.000Z | gallery/03_sp/plot_wavelets.py | RandallBalestriero/TheanoXLA | d8778c2eb3254b478cef4f45d934bf921e695619 | [
"Apache-2.0"
] | 4 | 2020-02-21T17:34:46.000Z | 2020-05-30T08:30:14.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# flake8: noqa
"""
Morlet Wavelet in time and Fourier domain
=========================================
This example shows how to generate a wavelet filter-bank.
"""
import symjax
import symjax.tensor as T
import matplotlib.pyplot as plt
import numpy as np
J = 5
Q = 4
s... | 22.170732 | 73 | 0.628163 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 221 | 0.243124 |
3a5d52f7066df721bcc6a4454c0e49f976cabd83 | 39 | py | Python | kfdata/__main__.py | kylef-archive/KFData.py | 685d58255c9f8518834e395d94d3b75d3dd3eceb | [
"BSD-3-Clause"
] | 1 | 2015-11-08T13:23:39.000Z | 2015-11-08T13:23:39.000Z | kfdata/__main__.py | kylef/KFData.py | 685d58255c9f8518834e395d94d3b75d3dd3eceb | [
"BSD-3-Clause"
] | null | null | null | kfdata/__main__.py | kylef/KFData.py | 685d58255c9f8518834e395d94d3b75d3dd3eceb | [
"BSD-3-Clause"
] | null | null | null | from kfdata.manage import main
main()
| 9.75 | 30 | 0.769231 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3a5f1a224d28494c27bf5124ac4e6a08b36bb55e | 240 | py | Python | com/sujoym/basic/sys.py | sujoym/python-examples | ee49a6aeb50749611341b2850587b30c38b34509 | [
"Apache-2.0"
] | null | null | null | com/sujoym/basic/sys.py | sujoym/python-examples | ee49a6aeb50749611341b2850587b30c38b34509 | [
"Apache-2.0"
] | null | null | null | com/sujoym/basic/sys.py | sujoym/python-examples | ee49a6aeb50749611341b2850587b30c38b34509 | [
"Apache-2.0"
] | null | null | null | import sys
#sys.stderr.write('Stderr text\n');
#sys.stderr.flush()
#sys.stdout.write('Stdout text\n');
#print(sys.argv[1])
#if len(sys.argv)>1:
# print(float(sys.argv[1])*5);
def main(arg1):
print(int(arg1)*4);
main(sys.argv[1]);
| 17.142857 | 35 | 0.641667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 160 | 0.666667 |
3a5f95c4dd3189822a688ab6608502a352c54b4b | 167 | py | Python | slackforms/handlers/__init__.py | Albatrous/django-slack-forms | baee37942085bf2f9e35beb9a4a4aa767b319b35 | [
"MIT"
] | 1 | 2019-06-20T00:11:58.000Z | 2019-06-20T00:11:58.000Z | slackforms/handlers/__init__.py | Albatrous/django-slack-forms | baee37942085bf2f9e35beb9a4a4aa767b319b35 | [
"MIT"
] | 3 | 2020-02-11T23:46:14.000Z | 2021-06-10T21:10:37.000Z | slackforms/handlers/__init__.py | Albatrous/django-slack-forms | baee37942085bf2f9e35beb9a4a4aa767b319b35 | [
"MIT"
] | 3 | 2019-12-13T06:53:18.000Z | 2021-06-04T07:12:56.000Z | # flake8: noqa
from .form import FormHandler
from .slash import SlashHandler
from .manual import ManualHandler
from .interactions import ActionHandler, MessageHandler
| 27.833333 | 55 | 0.838323 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 14 | 0.083832 |
3a5fa540aac3f4f6c53d13b040d514473b579d4b | 779 | py | Python | zensearch/exceptions.py | suryaavala/zen_search | 51a2a32a5963b8cda878b356c1225abe6aae6304 | [
"MIT"
] | null | null | null | zensearch/exceptions.py | suryaavala/zen_search | 51a2a32a5963b8cda878b356c1225abe6aae6304 | [
"MIT"
] | null | null | null | zensearch/exceptions.py | suryaavala/zen_search | 51a2a32a5963b8cda878b356c1225abe6aae6304 | [
"MIT"
] | null | null | null | class PrimaryKeyNotFoundError(Exception):
def __init__(self, *args):
if args:
self.message = args[0]
else:
self.message = None
self.default_message = "Cannot find primary key in the data point. Every data point should at least have primary key"
def __str__(self):... | 33.869565 | 162 | 0.653402 | 775 | 0.994865 | 0 | 0 | 0 | 0 | 0 | 0 | 242 | 0.310655 |
3a61c5a4f7f2b0b08f169681bdd4f9538e9142c6 | 13,902 | py | Python | RocMethod.py | meiyuanqing/MetaThreshold | fbccc7e5356606b929211eedaf5371506232c1b5 | [
"MIT"
] | null | null | null | RocMethod.py | meiyuanqing/MetaThreshold | fbccc7e5356606b929211eedaf5371506232c1b5 | [
"MIT"
] | null | null | null | RocMethod.py | meiyuanqing/MetaThreshold | fbccc7e5356606b929211eedaf5371506232c1b5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding:utf-8
"""
Author : Yuanqing Mei
Date : 2021/4/8
Time: 15:42
File: RocMethod.py
HomePage : http://github.com/yuanqingmei
Email : dg1533019@smail.nju.edu.cn
This script find out the cutoff of a metric value by maximizing the AUC value and ROC、BPP、MFM、GM methods.
References:
[1] Bender,... | 47.447099 | 120 | 0.535319 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5,164 | 0.342622 |
3a6257117bb5b39b2295a1e04bfebd82a73a4f27 | 1,372 | py | Python | app/models.py | jonathankamau/note-taking-app | f7315dbde34d1a06aa10bc0548fc85770fa4c142 | [
"MIT"
] | 1 | 2020-07-18T16:35:42.000Z | 2020-07-18T16:35:42.000Z | app/models.py | jonathankamau/note-taking-app | f7315dbde34d1a06aa10bc0548fc85770fa4c142 | [
"MIT"
] | 32 | 2020-07-19T18:19:24.000Z | 2021-06-04T23:45:34.000Z | app/models.py | jonathankamau/note-taking-app | f7315dbde34d1a06aa10bc0548fc85770fa4c142 | [
"MIT"
] | null | null | null | from django.db import models
from django.utils import timezone
from django.contrib.auth.models import User
class BaseModel(models.Model):
date_created = models.DateTimeField(auto_now_add=True)
date_modified = models.DateTimeField(auto_now=True)
class Meta:
abstract = True
class UserProfile(BaseMo... | 29.826087 | 78 | 0.715015 | 1,257 | 0.916181 | 0 | 0 | 0 | 0 | 0 | 0 | 82 | 0.059767 |
3a63a86305fa3e3ced908249d69f673dd8d16d58 | 717 | py | Python | migrations/versions/2018-09-27_12:25:31__3cbc86a0a9d7.py | gems-uff/sms | 01cfa84bd467617c58f58da04711c5097dd93fe6 | [
"MIT"
] | null | null | null | migrations/versions/2018-09-27_12:25:31__3cbc86a0a9d7.py | gems-uff/sms | 01cfa84bd467617c58f58da04711c5097dd93fe6 | [
"MIT"
] | null | null | null | migrations/versions/2018-09-27_12:25:31__3cbc86a0a9d7.py | gems-uff/sms | 01cfa84bd467617c58f58da04711c5097dd93fe6 | [
"MIT"
] | null | null | null | """empty message
Revision ID: 3cbc86a0a9d7
Revises: 77894fcde804
Create Date: 2018-09-27 12:25:31.893545
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '3cbc86a0a9d7'
down_revision = '77894fcde804'
branch_labels = None
depends_on = None
def upgrade():
# ... | 24.724138 | 106 | 0.707113 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 463 | 0.645746 |
3a640b59523119016904d7053ed1bc557df19331 | 2,685 | py | Python | mp_roguelike/ai.py | nonk123/mp_roguelike | 48785b44dd3f2518a5a639a6609670408e7ea1f5 | [
"MIT"
] | null | null | null | mp_roguelike/ai.py | nonk123/mp_roguelike | 48785b44dd3f2518a5a639a6609670408e7ea1f5 | [
"MIT"
] | null | null | null | mp_roguelike/ai.py | nonk123/mp_roguelike | 48785b44dd3f2518a5a639a6609670408e7ea1f5 | [
"MIT"
] | null | null | null | import random
from .util import sign
class AI:
def __init__(self, entity):
self.entity = entity
self.queued_path = []
def think(self):
if self.queued_path:
x, y = self.queued_path.pop(0)
self.move(x - self.entity.x, y - self.entity.y)
def move(self, dx, dy... | 26.584158 | 79 | 0.582495 | 2,639 | 0.982868 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3a640e6170ae4b45fbad29d7cf0c3f5b49ab9f01 | 83 | py | Python | mach_cad/model_obj/materials/__init__.py | Severson-Group/MachEval | dbb7999188133f8744636da53cab475ae538ce80 | [
"BSD-3-Clause"
] | 6 | 2021-11-02T20:12:32.000Z | 2021-11-13T10:50:35.000Z | mach_cad/model_obj/materials/__init__.py | Severson-Group/MachEval | dbb7999188133f8744636da53cab475ae538ce80 | [
"BSD-3-Clause"
] | 18 | 2021-11-29T20:14:55.000Z | 2022-03-02T07:17:37.000Z | mach_cad/model_obj/materials/__init__.py | Severson-Group/MachEval | dbb7999188133f8744636da53cab475ae538ce80 | [
"BSD-3-Clause"
] | 1 | 2022-01-29T00:52:38.000Z | 2022-01-29T00:52:38.000Z |
from .material_generic import *
__all__ = []
__all__ += material_generic.__all__ | 13.833333 | 35 | 0.759036 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3a6432af138a6ef234f6f37cbbda6934b7bb3c37 | 7,657 | py | Python | hpc-historias-clinicas/settings.py | btenaglia/hpc-historias-clinicas | 649d8660381381b1c591667760c122d73071d5ec | [
"BSD-3-Clause"
] | null | null | null | hpc-historias-clinicas/settings.py | btenaglia/hpc-historias-clinicas | 649d8660381381b1c591667760c122d73071d5ec | [
"BSD-3-Clause"
] | null | null | null | hpc-historias-clinicas/settings.py | btenaglia/hpc-historias-clinicas | 649d8660381381b1c591667760c122d73071d5ec | [
"BSD-3-Clause"
] | null | null | null | import os
PROJECT_ROOT = os.path.dirname(__file__)
# DEBUG
# See: https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = False
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-debug
TEMPLATE_DEBUG = DEBUG
# END DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS... | 38.094527 | 87 | 0.750947 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6,203 | 0.810108 |
3a66f861ec173370f50a0b31924da0bccb5e1872 | 2,661 | py | Python | romanyh/transposition.py | napulen/romanyh | 34bc75d40bf532eb20607db763fcbc2693cac35f | [
"BSD-3-Clause"
] | null | null | null | romanyh/transposition.py | napulen/romanyh | 34bc75d40bf532eb20607db763fcbc2693cac35f | [
"BSD-3-Clause"
] | 5 | 2020-12-08T04:37:21.000Z | 2021-01-06T03:36:30.000Z | romanyh/transposition.py | napulen/romanyh | 34bc75d40bf532eb20607db763fcbc2693cac35f | [
"BSD-3-Clause"
] | null | null | null | import re
import sys
from music21.interval import Interval
from music21.key import Key
def findKeysInRomanTextString(rntxt):
"""Get all the keys in a RomanText string.
Receive a string with valid RomanText content.
Output a list of all the key changes that happen
throughout the content.
"""
... | 36.452055 | 70 | 0.693724 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,009 | 0.379181 |
3a67795832eb29853a6ccb60a0d65c013b0a8f82 | 4,847 | py | Python | management_api_app/tests_ma/test_service_bus/test_deployment_status_update.py | LizaShak/AzureTRE | b845eb4b73439ef7819565aaadb36f43b6484ad9 | [
"MIT"
] | 2 | 2021-11-14T16:57:16.000Z | 2022-03-13T15:14:26.000Z | management_api_app/tests_ma/test_service_bus/test_deployment_status_update.py | anatbal/AzureTRE | d1d4891657c737092e761c4aaf80b04ff0f03fc7 | [
"MIT"
] | null | null | null | management_api_app/tests_ma/test_service_bus/test_deployment_status_update.py | anatbal/AzureTRE | d1d4891657c737092e761c4aaf80b04ff0f03fc7 | [
"MIT"
] | null | null | null | import json
import pytest
import uuid
from mock import AsyncMock, patch
from db.errors import EntityDoesNotExist
from models.domain.resource import Status
from models.domain.workspace import Workspace
from models.domain.resource import Deployment
from resources import strings
from service_bus.deployment_status_update... | 41.784483 | 115 | 0.810192 | 222 | 0.045802 | 0 | 0 | 3,662 | 0.755519 | 2,958 | 0.610274 | 727 | 0.14999 |
3a67c5e3bdd0bcd555184047e8d52728b4026b70 | 1,384 | py | Python | fms-python/face_core.py | seanarwa/firm | 774965004766c2ce59e17bb08692370280b3e95c | [
"Apache-2.0"
] | null | null | null | fms-python/face_core.py | seanarwa/firm | 774965004766c2ce59e17bb08692370280b3e95c | [
"Apache-2.0"
] | null | null | null | fms-python/face_core.py | seanarwa/firm | 774965004766c2ce59e17bb08692370280b3e95c | [
"Apache-2.0"
] | null | null | null | import os
import time
import logging as log
import numpy as np
from scikit-learn.preprocessing import normalize
# local modules
import config
def process(encoding):
normalized_encoding = get_quantized_features(encoding)
return normalized_encoding
def get_median_values_for_bins(bins):
median_values = {}... | 33.756098 | 126 | 0.760838 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 108 | 0.078035 |
3a695ae89ca40a6004f7716018ec39b583cbbbfd | 1,587 | py | Python | tests/sms/models/test_reschedule_sms_messages.py | infobip-community/infobip-api-python-sdk | 5ffc5ab877ee1748aa29391f991c8c5324387487 | [
"MIT"
] | null | null | null | tests/sms/models/test_reschedule_sms_messages.py | infobip-community/infobip-api-python-sdk | 5ffc5ab877ee1748aa29391f991c8c5324387487 | [
"MIT"
] | null | null | null | tests/sms/models/test_reschedule_sms_messages.py | infobip-community/infobip-api-python-sdk | 5ffc5ab877ee1748aa29391f991c8c5324387487 | [
"MIT"
] | null | null | null | from datetime import date, datetime, timedelta
import pytest
from pydantic.error_wrappers import ValidationError
from infobip_channels.sms.models.body.reschedule_sms_messages import (
RescheduleSMSMessagesMessageBody,
)
from infobip_channels.sms.models.query_parameters.reschedule_messages import (
RescheduleS... | 27.842105 | 83 | 0.672968 | 0 | 0 | 0 | 0 | 636 | 0.400756 | 0 | 0 | 156 | 0.098299 |
3a69ee7bd76a61928b4ca3a0383eeeac9e541646 | 8,349 | py | Python | python/mxnet/device.py | t-triobox/incubator-mxnet | 93aa9e33fcb2f216179c691ed9461bc96e37ae70 | [
"Apache-2.0"
] | 1 | 2021-11-09T01:40:17.000Z | 2021-11-09T01:40:17.000Z | python/mxnet/device.py | t-triobox/incubator-mxnet | 93aa9e33fcb2f216179c691ed9461bc96e37ae70 | [
"Apache-2.0"
] | null | null | null | python/mxnet/device.py | t-triobox/incubator-mxnet | 93aa9e33fcb2f216179c691ed9461bc96e37ae70 | [
"Apache-2.0"
] | 1 | 2018-07-19T00:43:30.000Z | 2018-07-19T00:43:30.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 28.016779 | 108 | 0.618517 | 3,556 | 0.425919 | 0 | 0 | 372 | 0.044556 | 0 | 0 | 6,173 | 0.73937 |
3a6a4945d24f523a66e8dd1cc3a18e4d3749558b | 5,578 | py | Python | _pkg_KuFunc/mod_SetLabel.py | tianlunjiang/_NukeStudio_v2 | 5ed9b9217aff16d903bdcda5c2f1e1cd3bebe367 | [
"CNRI-Python"
] | 6 | 2019-08-27T01:30:15.000Z | 2020-11-17T00:40:01.000Z | _pkg_KuFunc/mod_SetLabel.py | tianlunjiang/_NukeMods | 47861bfc273262abba55b9f9a61782a5d89479b1 | [
"CNRI-Python"
] | 2 | 2019-01-22T04:09:28.000Z | 2019-01-23T15:11:39.000Z | _pkg_KuFunc/mod_SetLabel.py | tianlunjiang/_NukeMods | 47861bfc273262abba55b9f9a61782a5d89479b1 | [
"CNRI-Python"
] | 1 | 2020-08-03T22:43:23.000Z | 2020-08-03T22:43:23.000Z |
# ------------------------------------------------------------------------------
# Module Import
# ------------------------------------------------------------------------------
import nuke, nukescripts
import platform
from Qt import QtWidgets, QtGui, QtCore
#------------------------------------------------... | 25.126126 | 103 | 0.573682 | 2,444 | 0.43815 | 0 | 0 | 0 | 0 | 0 | 0 | 2,354 | 0.422015 |
3a6bbdcced64c871e2fdd5b7e14da08f29defe31 | 897 | py | Python | account/migrations/0003_auto_20161110_2135.py | fitahol/fitahol | ce84dc909aa98f2dc7594ef26568e015cbfe0e94 | [
"MIT"
] | 2 | 2017-02-20T14:11:30.000Z | 2017-06-11T16:10:33.000Z | account/migrations/0003_auto_20161110_2135.py | fitahol/fitahol | ce84dc909aa98f2dc7594ef26568e015cbfe0e94 | [
"MIT"
] | null | null | null | account/migrations/0003_auto_20161110_2135.py | fitahol/fitahol | ce84dc909aa98f2dc7594ef26568e015cbfe0e94 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-11-10 21:35
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('account', '0002_auto_20161103_0100'),
]
operations = [
migrations.AlterModel... | 27.181818 | 102 | 0.585284 | 772 | 0.831001 | 0 | 0 | 0 | 0 | 0 | 0 | 302 | 0.325081 |
3a6c6afbecc178b754f00e36139090ce170c777c | 780 | py | Python | imgur_stuff.py | djs2022/DataEntrySite | aac8e71fe0a8b159113b1488cbe7a8a7e641bf1d | [
"MIT"
] | null | null | null | imgur_stuff.py | djs2022/DataEntrySite | aac8e71fe0a8b159113b1488cbe7a8a7e641bf1d | [
"MIT"
] | null | null | null | imgur_stuff.py | djs2022/DataEntrySite | aac8e71fe0a8b159113b1488cbe7a8a7e641bf1d | [
"MIT"
] | null | null | null | import requests
import os
class Imgur():
client_id = None
remCredits = None
def __init__(self, clientID):
self.client_id = clientID
def uploadImage(self, file, title, description):
file.save(file.filename)
with open(file.filename, 'rb') as f:
data = f.read()
... | 27.857143 | 77 | 0.574359 | 751 | 0.962821 | 0 | 0 | 0 | 0 | 0 | 0 | 133 | 0.170513 |
3a6d77c44f6c1309b10cae742c418b58169828c7 | 4,489 | py | Python | roles/tox/library/tox_parse_output.py | g-chauvel/zuul-jobs | 7ea241a626f2f2e05d4aeb8cf0328d22736b1f0f | [
"Apache-2.0"
] | null | null | null | roles/tox/library/tox_parse_output.py | g-chauvel/zuul-jobs | 7ea241a626f2f2e05d4aeb8cf0328d22736b1f0f | [
"Apache-2.0"
] | null | null | null | roles/tox/library/tox_parse_output.py | g-chauvel/zuul-jobs | 7ea241a626f2f2e05d4aeb8cf0328d22736b1f0f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2018 Red Hat
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This software is di... | 28.775641 | 74 | 0.642237 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,738 | 0.387169 |
3a6f8d05144479257560ebcab7dfac73539e7dff | 4,199 | py | Python | rpyc/utils/authenticators.py | fruch/rpyc | 8db3fdcef2272d468aca562465279370d075be72 | [
"MIT"
] | null | null | null | rpyc/utils/authenticators.py | fruch/rpyc | 8db3fdcef2272d468aca562465279370d075be72 | [
"MIT"
] | null | null | null | rpyc/utils/authenticators.py | fruch/rpyc | 8db3fdcef2272d468aca562465279370d075be72 | [
"MIT"
] | null | null | null | """
authenticators: the server instance accepts an authenticator object,
which is basically any callable (i.e., a function) that takes the newly
connected socket and "authenticates" it.
the authenticator should return a socket-like object with its associated
credentials (a tuple), or raise AuthenticationError if it ... | 32.550388 | 92 | 0.639676 | 2,856 | 0.680162 | 0 | 0 | 1,049 | 0.249821 | 0 | 0 | 1,447 | 0.344606 |
3a71c85b49b297a21ae96cfc5a938c33c9b45b83 | 1,156 | py | Python | kratos/apps/configuration/migrations/0001_initial.py | cipher-ops/backend-kts | 7ea54d7f56bcb0da54b901ac8f3cfbfbb0b12319 | [
"MIT"
] | 1 | 2020-11-30T09:53:40.000Z | 2020-11-30T09:53:40.000Z | kratos/apps/configuration/migrations/0001_initial.py | cipher-ops/backend-kts | 7ea54d7f56bcb0da54b901ac8f3cfbfbb0b12319 | [
"MIT"
] | null | null | null | kratos/apps/configuration/migrations/0001_initial.py | cipher-ops/backend-kts | 7ea54d7f56bcb0da54b901ac8f3cfbfbb0b12319 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.5 on 2020-09-21 06:44
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('app', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Confi... | 35.030303 | 132 | 0.583045 | 1,030 | 0.891003 | 0 | 0 | 0 | 0 | 0 | 0 | 199 | 0.172145 |
3a734bc1e70aa19debbc9af66f403f4c7634a66a | 2,823 | py | Python | events/migrations/0002_auto_20180325_0035.py | eforsell/eurovisiontippning | 1a26dac0e06c5eef9a752ea6f68ad9b9567b6261 | [
"MIT"
] | null | null | null | events/migrations/0002_auto_20180325_0035.py | eforsell/eurovisiontippning | 1a26dac0e06c5eef9a752ea6f68ad9b9567b6261 | [
"MIT"
] | null | null | null | events/migrations/0002_auto_20180325_0035.py | eforsell/eurovisiontippning | 1a26dac0e06c5eef9a752ea6f68ad9b9567b6261 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.3 on 2018-03-24 23:35
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('events', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | 34.426829 | 139 | 0.557563 | 2,668 | 0.945094 | 0 | 0 | 0 | 0 | 0 | 0 | 500 | 0.177117 |
3a737b4d0699668e68dfd11d0393dc995f8e0e88 | 574 | py | Python | python-code/transformer-sample/basic/sentiment_analysis.py | 87-midnight/NewbieInJava | ba84153c6b3a382e620c4df7892d653be2e1a607 | [
"MIT"
] | null | null | null | python-code/transformer-sample/basic/sentiment_analysis.py | 87-midnight/NewbieInJava | ba84153c6b3a382e620c4df7892d653be2e1a607 | [
"MIT"
] | 2 | 2019-10-22T08:21:09.000Z | 2019-10-22T08:21:09.000Z | python-code/transformer-sample/basic/sentiment_analysis.py | 87-midnight/NewbieInJava | ba84153c6b3a382e620c4df7892d653be2e1a607 | [
"MIT"
] | null | null | null | # 使用情绪分析流水线
import torch
from transformers import BertTokenizer, BertForSequenceClassification
torch.manual_seed(0)
tokenizer = BertTokenizer.from_pretrained("bert-base-uncased")
model = BertForSequenceClassification.from_pretrained("bert-base-uncased", problem_type="multi_label_classification", num_labels=2)
inputs ... | 41 | 131 | 0.801394 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 162 | 0.273649 |
3a750f402f6cc67161071bf3b54785b45c55a45d | 1,293 | py | Python | examples/tutorial/parallel_amuse_script.py | rknop/amuse | 85d5bdcc29cfc87dc69d91c264101fafd6658aec | [
"Apache-2.0"
] | 131 | 2015-06-04T09:06:57.000Z | 2022-02-01T12:11:29.000Z | examples/tutorial/parallel_amuse_script.py | rknop/amuse | 85d5bdcc29cfc87dc69d91c264101fafd6658aec | [
"Apache-2.0"
] | 690 | 2015-10-17T12:18:08.000Z | 2022-03-31T16:15:58.000Z | examples/tutorial/parallel_amuse_script.py | rieder/amuse | 3ac3b6b8f922643657279ddee5c8ab3fc0440d5e | [
"Apache-2.0"
] | 102 | 2015-01-22T10:00:29.000Z | 2022-02-09T13:29:43.000Z | import time
import numpy
from amuse.lab import Huayno
from amuse.lab import Hermite
from amuse.lab import nbody_system
from amuse.lab import new_king_model
from matplotlib import pyplot
def gravity_minimal(bodies, t_end, nproc):
gravity = Hermite(number_of_workers=nproc)
gravity.particles.add_particles(bodies... | 25.352941 | 71 | 0.664346 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 121 | 0.093581 |
3a75e62e27fdd3a634c7ec673852b4fb62407232 | 311 | py | Python | modules/random_cat.py | ChaseBosman/chatbot | a39e655e6d586fa596471cd20617dff5f9795a96 | [
"Unlicense"
] | 3 | 2019-10-19T12:07:06.000Z | 2020-10-05T17:24:56.000Z | modules/random_cat.py | ChaseBosman/chatbot | a39e655e6d586fa596471cd20617dff5f9795a96 | [
"Unlicense"
] | 17 | 2019-10-05T12:30:17.000Z | 2021-07-25T20:06:33.000Z | modules/random_cat.py | ChaseBosman/chatbot | a39e655e6d586fa596471cd20617dff5f9795a96 | [
"Unlicense"
] | 26 | 2018-10-19T05:43:12.000Z | 2020-10-02T05:27:48.000Z | import requests
import json
def random_cat_pic():
try:
url = 'http://aws.random.cat/meow'
response = requests.get(url)
response_json = json.loads(response.text)
return "Here's a super cute cat pic: " + response_json.get('file')
except:
return "Error meow"
| 25.916667 | 74 | 0.614148 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 77 | 0.247588 |
3a788b9c9eab36584491247515f283acec64a519 | 407 | py | Python | Pycharm_Project/0414/2.py | duanjiefei/Python-Study | 88e17a3eab9112a2515f09b2bcf4e032059cc28b | [
"Apache-2.0"
] | null | null | null | Pycharm_Project/0414/2.py | duanjiefei/Python-Study | 88e17a3eab9112a2515f09b2bcf4e032059cc28b | [
"Apache-2.0"
] | null | null | null | Pycharm_Project/0414/2.py | duanjiefei/Python-Study | 88e17a3eab9112a2515f09b2bcf4e032059cc28b | [
"Apache-2.0"
] | null | null | null | #装饰器的结构
import time
def timer(func):
def wrapper(*args,**kwargs):#args 用来接收元祖 kwargs用来接收字典
start_time = time.time()
func(*args,**kwargs)
end_time = time.time()
print("the function run time is %s" %(end_time-start_time))
return wrapper;
@timer
def test():
time.sleep(1)
p... | 20.35 | 67 | 0.619165 | 0 | 0 | 0 | 0 | 62 | 0.139955 | 0 | 0 | 167 | 0.376975 |
3a794a8245df8781f9b1fc1f4f5373e8c9e7411d | 3,255 | py | Python | docs/source/conf.py | DanielWarfield1/nClusterFramework | 21b68226ab1ffa810281a261feabe1d360a5146d | [
"MIT"
] | null | null | null | docs/source/conf.py | DanielWarfield1/nClusterFramework | 21b68226ab1ffa810281a261feabe1d360a5146d | [
"MIT"
] | 2 | 2021-12-15T05:36:01.000Z | 2021-12-20T01:15:45.000Z | docs/source/conf.py | DanielWarfield1/nClusterFramework | 21b68226ab1ffa810281a261feabe1d360a5146d | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 44.589041 | 97 | 0.710906 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,609 | 0.801536 |