hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3e3f9b87931b258e09b3fe858882d18f34fac325 | 10,049 | py | Python | models/pix2pix_model.py | NguyenHoangAn0511/gan-compression | 6512c067d4adebc7451635991418b54ab76dd711 | [
"BSD-3-Clause"
] | 1,005 | 2020-03-20T04:13:59.000Z | 2022-03-30T01:16:45.000Z | models/pix2pix_model.py | shadow2496/gan-compression | 9f3a2b51bedca040cc7d31c60ca71a77138f2c81 | [
"BSD-3-Clause"
] | 94 | 2020-03-20T08:36:57.000Z | 2022-03-12T00:20:02.000Z | models/pix2pix_model.py | shadow2496/gan-compression | 9f3a2b51bedca040cc7d31c60ca71a77138f2c81 | [
"BSD-3-Clause"
] | 147 | 2020-03-20T04:49:35.000Z | 2022-03-23T10:44:25.000Z | import ntpath
import os
import numpy as np
import torch
from torch import nn
from tqdm import tqdm
from data import create_eval_dataloader
from metric import get_fid, get_cityscapes_mIoU
from metric.cityscapes_mIoU import DRNSeg
from metric.inception import InceptionV3
from models import networks
from models.base_mod... | 47.400943 | 150 | 0.616479 |
8a6314beccd3dce353b1034da94bca36f90164db | 15,689 | py | Python | vasp/extract_report.py | hsulab/DailyScripts | 26b03cfb721fd66f39c86df50d2ec5866e651d6e | [
"MIT"
] | 2 | 2020-06-08T21:39:44.000Z | 2020-10-18T15:12:47.000Z | vasp/extract_report.py | hsulab/DailyScripts | 26b03cfb721fd66f39c86df50d2ec5866e651d6e | [
"MIT"
] | null | null | null | vasp/extract_report.py | hsulab/DailyScripts | 26b03cfb721fd66f39c86df50d2ec5866e651d6e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import argparse
import numpy as np
import pandas as pd
#import pyblock as pb
import matplotlib as mpl
mpl.use('Agg') #silent mode
from matplotlib import pyplot as plt
"""
Author: Jiayan Xu
"""
NLINTRO = 50 # number of lines in intro part
NLSTEP = 200
MAXCO... | 34.330416 | 82 | 0.494742 |
5916dcff62610702a2f6eb43e2456ad1b8094ef0 | 5,529 | py | Python | manga_py/cli/args.py | terepanda/manga-dl | 2ac3a314c2f67ad22f6da7e293ec6b3a132d7834 | [
"MIT"
] | null | null | null | manga_py/cli/args.py | terepanda/manga-dl | 2ac3a314c2f67ad22f6da7e293ec6b3a132d7834 | [
"MIT"
] | null | null | null | manga_py/cli/args.py | terepanda/manga-dl | 2ac3a314c2f67ad22f6da7e293ec6b3a132d7834 | [
"MIT"
] | null | null | null | from argparse import ArgumentParser
from manga_py.meta import __version__
def _image_args(args_parser): # pragma: no cover
args = args_parser.add_argument_group('Image options')
args.add_argument('--not-change-files-extension', action='store_const',
help='Save files to archive "as is"... | 54.205882 | 105 | 0.646772 |
570523acf5f462dde78f16811bc5cf0f0c7f3ec5 | 1,463 | py | Python | pbxplore/structure/loader.py | jbarnoud/PBxplore | ad588dc86a4fbd7259ec5f304851b6c99df29993 | [
"MIT"
] | null | null | null | pbxplore/structure/loader.py | jbarnoud/PBxplore | ad588dc86a4fbd7259ec5f304851b6c99df29993 | [
"MIT"
] | null | null | null | pbxplore/structure/loader.py | jbarnoud/PBxplore | ad588dc86a4fbd7259ec5f304851b6c99df29993 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
# Local module
from .structure import Chain, Atom
from .PDB import PDB
# Conditional import
try:
import MDAnalysis
except ImportError:
IS_MDANALYSIS = False
else:
IS_MDANALYSIS = True
# Create the __all__ keyword acco... | 26.125 | 64 | 0.653452 |
ac65e64281f96397f15bd44ab44241ad52943a1b | 13,313 | py | Python | sympy/printing/preview.py | FabianBall/sympy | 9d849ddfc45427fe7f6733ce4d18fa397d0f43a9 | [
"BSD-3-Clause"
] | 3 | 2015-01-17T23:15:04.000Z | 2015-05-26T14:11:44.000Z | sympy/printing/preview.py | FabianBall/sympy | 9d849ddfc45427fe7f6733ce4d18fa397d0f43a9 | [
"BSD-3-Clause"
] | 1 | 2017-08-26T01:07:46.000Z | 2017-08-26T16:05:49.000Z | sympy/printing/preview.py | leosartaj/sympy | 28d913d3cead6c5646307ffa6540b21d65059dfd | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function, division
import os
from os.path import join
import tempfile
import shutil
import io
from io import BytesIO
try:
from subprocess import STDOUT, CalledProcessError, check_output
except ImportError:
pass
from sympy.core.compatibility import unicode, u_decode
from sympy.ut... | 37.928775 | 99 | 0.551566 |
49f00b4618edd011da26b890b8f01b48a6527293 | 564 | py | Python | output/models/nist_data/atomic/g_year/schema_instance/nistschema_sv_iv_atomic_g_year_max_exclusive_4_xsd/nistschema_sv_iv_atomic_g_year_max_exclusive_4.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/nist_data/atomic/g_year/schema_instance/nistschema_sv_iv_atomic_g_year_max_exclusive_4_xsd/nistschema_sv_iv_atomic_g_year_max_exclusive_4.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/nist_data/atomic/g_year/schema_instance/nistschema_sv_iv_atomic_g_year_max_exclusive_4_xsd/nistschema_sv_iv_atomic_g_year_max_exclusive_4.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from typing import Optional
from xsdata.models.datatype import XmlPeriod
__NAMESPACE__ = "NISTSchema-SV-IV-atomic-gYear-maxExclusive-4-NS"
@dataclass
class NistschemaSvIvAtomicGYearMaxExclusive4:
class Meta:
name = "NISTSchema-SV-IV-atomic-gYear-maxExclusive-4"
... | 26.857143 | 69 | 0.68617 |
19e2281ed5a751a9c2b4a78d14ed9474e589f50b | 3,625 | py | Python | docs/publish_docs.py | Jasonnor/airflow | 2bcd674a48a3decf8835d761c7bfd407f74a4f11 | [
"Apache-2.0"
] | null | null | null | docs/publish_docs.py | Jasonnor/airflow | 2bcd674a48a3decf8835d761c7bfd407f74a4f11 | [
"Apache-2.0"
] | null | null | null | docs/publish_docs.py | Jasonnor/airflow | 2bcd674a48a3decf8835d761c7bfd407f74a4f11 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# 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
# "L... | 34.198113 | 108 | 0.716138 |
ad67a79b39019425263b4d8e465394d1f68c8e11 | 55,019 | py | Python | elementpath/xpath2/xpath2_functions.py | sissaschool/elementpath | a74ce89c04622d8ae98ab739886c3e46f87b024e | [
"MIT"
] | 21 | 2019-10-02T18:36:16.000Z | 2022-03-14T15:46:00.000Z | elementpath/xpath2/xpath2_functions.py | sissaschool/elementpath | a74ce89c04622d8ae98ab739886c3e46f87b024e | [
"MIT"
] | 32 | 2019-08-28T13:04:16.000Z | 2021-12-16T17:05:49.000Z | elementpath/xpath2/xpath2_functions.py | sissaschool/elementpath | a74ce89c04622d8ae98ab739886c3e46f87b024e | [
"MIT"
] | 9 | 2019-08-28T11:24:49.000Z | 2022-01-12T23:53:28.000Z | #
# Copyright (c), 2018-2021, SISSA (International School for Advanced Studies).
# All rights reserved.
# This file is distributed under the terms of the MIT License.
# See the file 'LICENSE' in the root directory of the present
# distribution, or http://opensource.org/licenses/MIT.
#
# @author Davide Brunato <brunato@... | 37.684247 | 100 | 0.630855 |
e1e7e08ab978dfc1a40609f8a6999224bd57443b | 20,651 | py | Python | Python/flow_records.py | cpajr/flowanalyzer | 632052d63361eca38d293d59f168dc4d0c6734c1 | [
"BSD-3-Clause"
] | 1 | 2021-10-13T00:06:41.000Z | 2021-10-13T00:06:41.000Z | Python/flow_records.py | cpajr/flowanalyzer | 632052d63361eca38d293d59f168dc4d0c6734c1 | [
"BSD-3-Clause"
] | null | null | null | Python/flow_records.py | cpajr/flowanalyzer | 632052d63361eca38d293d59f168dc4d0c6734c1 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2016, Manito Networks, LLC
# All rights reserved.
import struct
import sys
from xdrlib import Unpacker
from parser_modules import mac_address,http_parse # Field parsing functions
from sflow_parsers import * # Functions to parse headers and format numbers
# Raw Packet Header (Flow, Enterprise 0, Form... | 38.744841 | 115 | 0.722774 |
9402a0f3bd763236632f6c34b6d7ff1220f57983 | 1,654 | py | Python | congressideology/data_collection/collect_bill_data.py | crazyfrogspb/CongressIdeology | a661773b578c09445006c7d5a3d827c125748b9d | [
"MIT"
] | null | null | null | congressideology/data_collection/collect_bill_data.py | crazyfrogspb/CongressIdeology | a661773b578c09445006c7d5a3d827c125748b9d | [
"MIT"
] | 5 | 2020-03-24T16:29:20.000Z | 2021-12-13T19:52:47.000Z | congressideology/data_collection/collect_bill_data.py | crazyfrogspb/CongressIdeology | a661773b578c09445006c7d5a3d827c125748b9d | [
"MIT"
] | null | null | null | import argparse
import os
import os.path as osp
from time import sleep
import pandas as pd
from congress import Congress
from congress.utils import NotFound
from dotenv import find_dotenv, load_dotenv
from congressideology.config import config
load_dotenv(find_dotenv())
congress = Congress(os.getenv('PROPUBLICA_API... | 31.207547 | 89 | 0.660218 |
094e98b25e077af216428bf5ef136b4aba14008b | 1,829 | py | Python | themes/pygments/pygments_base16/base16-twilight.py | base16-fork/base16-fork | 79856b7e6195dde0874a9e6d191101ac6c5c74f5 | [
"MIT"
] | 13 | 2017-06-02T16:57:13.000Z | 2021-04-12T09:03:59.000Z | pygments_base16/base16-twilight.py | pradyunsg/base16-pygments | de39f100a46df33d63428fef36b203979f85a588 | [
"MIT"
] | 4 | 2017-07-27T15:33:17.000Z | 2021-03-03T21:07:23.000Z | pygments_base16/base16-twilight.py | pradyunsg/base16-pygments | de39f100a46df33d63428fef36b203979f85a588 | [
"MIT"
] | 9 | 2017-07-27T08:59:22.000Z | 2022-01-06T19:48:09.000Z | from pygments.style import Style
from pygments.token import (
Comment, Error, Keyword, Literal, Name, Number, Operator, String, Text
)
class Base16Style(Style):
base00 = '#1e1e1e'
base01 = '#323537'
base02 = '#464b50'
base03 = '#5f5a60'
base04 = '#838184'
base05 = '#a7a7a7'
base06 = '#... | 24.716216 | 74 | 0.563149 |
6e3a53059b1b06dadc17f5f377f4f3e72bcef622 | 147 | py | Python | web/irradiations/admin.py | NMGRL/pychron_web | e3a3afcc35f17556e70934f113d9d4508dc304d7 | [
"Apache-2.0"
] | null | null | null | web/irradiations/admin.py | NMGRL/pychron_web | e3a3afcc35f17556e70934f113d9d4508dc304d7 | [
"Apache-2.0"
] | 17 | 2021-09-09T14:28:16.000Z | 2022-03-31T16:11:30.000Z | web/irradiations/admin.py | NMGRL/pychron_web | e3a3afcc35f17556e70934f113d9d4508dc304d7 | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
# Register your models here.
from irradiations.models import Irradiationtbl
admin.site.register(Irradiationtbl)
| 21 | 46 | 0.836735 |
b90bcffc3207e17ea6a3e1f537f9ffea55024eb8 | 932 | py | Python | app/final/__init__.py | pratik1596/IS601-FinalProject | 133a40cb455399ade2a0f3f5c769826014a523e3 | [
"MIT"
] | null | null | null | app/final/__init__.py | pratik1596/IS601-FinalProject | 133a40cb455399ade2a0f3f5c769826014a523e3 | [
"MIT"
] | null | null | null | app/final/__init__.py | pratik1596/IS601-FinalProject | 133a40cb455399ade2a0f3f5c769826014a523e3 | [
"MIT"
] | null | null | null | from flask import Flask
from flaskext.mysql import MySQL
from pymysql.cursors import DictCursor
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_session import Session
from flask_assets import Environment
from . import view
db = SQLAlchemy()
mysql = MySQL(cursorclass=DictCursor)
... | 23.3 | 49 | 0.72103 |
ca5612338de26b56c2aaa6743d5bbe91fc11e6f3 | 176 | py | Python | Prims/converter.py | jeff-lund/CS350 | 7227b53275c62d45e899a531136a96a866c32a16 | [
"MIT"
] | 2 | 2019-10-16T01:59:42.000Z | 2019-11-13T19:25:00.000Z | Prims/converter.py | jeff-lund/CS350 | 7227b53275c62d45e899a531136a96a866c32a16 | [
"MIT"
] | null | null | null | Prims/converter.py | jeff-lund/CS350 | 7227b53275c62d45e899a531136a96a866c32a16 | [
"MIT"
] | 2 | 2019-10-16T01:59:49.000Z | 2019-11-15T01:19:18.000Z | f = open('routes_mod.txt', 'r')
fout = open('proutes.txt', 'w')
for line in f:
line = line.strip().split(' ')
fout.write(', '.join(line) + '\n')
f.close()
fout.close()
| 22 | 38 | 0.5625 |
6d586475303b1d86fcdb7c4a5bcd5a2a39f243af | 625 | py | Python | builder/utils/util_name.py | My-Novel-Management/storybuilderunite | c003d3451e237f574c54a87ea7d4fd8da8e833be | [
"MIT"
] | 1 | 2020-06-18T01:38:55.000Z | 2020-06-18T01:38:55.000Z | builder/utils/util_name.py | My-Novel-Management/storybuilder | 1f36e56a74dbb55a25d60fce3ce81f3c650f521a | [
"MIT"
] | 143 | 2019-11-13T00:21:11.000Z | 2020-08-15T05:47:41.000Z | builder/utils/util_name.py | My-Novel-Management/storybuilderunite | c003d3451e237f574c54a87ea7d4fd8da8e833be | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Name Utility methods
====================
'''
__all__ = (
'name_set_from',
)
from builder.utils import assertion
def name_set_from(basename: str, name: str) -> tuple:
lastname = firstname = fullname = exfullname = ''
tmp = assertion.is_str(basename) if basename e... | 24.038462 | 76 | 0.6096 |
c8fc5dd6cbf1de15e31ffd20a964cb9186f6f826 | 7,238 | py | Python | S12/S12_Modular_Code/eval.py | pankaj90382/TSAI-2 | af4b3543dfb206fb1cc2bd166ed31e9ea7bd3778 | [
"MIT"
] | null | null | null | S12/S12_Modular_Code/eval.py | pankaj90382/TSAI-2 | af4b3543dfb206fb1cc2bd166ed31e9ea7bd3778 | [
"MIT"
] | 9 | 2021-06-08T22:18:08.000Z | 2022-03-12T00:46:43.000Z | S12/S12_Modular_Code/eval.py | pankaj90382/TSAI-2 | af4b3543dfb206fb1cc2bd166ed31e9ea7bd3778 | [
"MIT"
] | 1 | 2020-10-12T17:13:35.000Z | 2020-10-12T17:13:35.000Z | import json
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import torchvision.transforms as transforms
from datasets import *
from utils import *
from nltk.translate.bleu_score import corpus_bleu
import torch.nn.functional as F
from tqdm import tqdm
# Parameters
data_folder = 'data' #... | 39.98895 | 175 | 0.638574 |
fa20ef9e1083deafc50859142152b00fd02d1e68 | 11,544 | py | Python | pydpkg/dsc.py | memory/python-dpkg | b88fe8f2d454d3f2c56c9d92be8ffa8ed2c02212 | [
"Apache-2.0"
] | 4 | 2021-03-03T15:37:51.000Z | 2021-12-15T21:04:22.000Z | pydpkg/dsc.py | memory/python-dpkg | b88fe8f2d454d3f2c56c9d92be8ffa8ed2c02212 | [
"Apache-2.0"
] | 2 | 2020-11-20T13:12:14.000Z | 2021-12-04T21:08:36.000Z | pydpkg/dsc.py | memory/python-dpkg | b88fe8f2d454d3f2c56c9d92be8ffa8ed2c02212 | [
"Apache-2.0"
] | 5 | 2021-07-01T10:41:18.000Z | 2021-12-10T11:53:13.000Z | """ pydpkg.dpkg.Dpkg: a class to represent dpkg files """
# stdlib imports
import hashlib
import logging
import os
from collections import defaultdict
from email import message_from_file, message_from_string
import pgpy
# pypi imports
import six
# local imports
from pydpkg.exceptions import (
DscMissingFileErro... | 39 | 87 | 0.599359 |
79698e9965ab0908c174bb2255949e76b1d411fd | 4,819 | py | Python | causalnlp/_nbdev.py | vishalbelsare/causalnlp | c21406f3ca40fd951e52e777d923c4331b2d46d1 | [
"Apache-2.0"
] | 66 | 2021-05-30T08:15:39.000Z | 2022-02-03T11:29:50.000Z | causalnlp/_nbdev.py | vishalbelsare/causalnlp | c21406f3ca40fd951e52e777d923c4331b2d46d1 | [
"Apache-2.0"
] | 1 | 2021-10-20T04:51:27.000Z | 2021-10-20T04:51:27.000Z | causalnlp/_nbdev.py | vishalbelsare/causalnlp | c21406f3ca40fd951e52e777d923c4331b2d46d1 | [
"Apache-2.0"
] | 4 | 2021-08-24T14:24:03.000Z | 2022-01-23T03:41:40.000Z | # AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"CausalInferenceModel": "00a_core.causalinference.ipynb",
"metalearner_cls_dict": "00a_core.causalinference.ipynb",
"metalearner_reg_dict": "00a_core.causalinference.ipynb",
"platt_... | 47.245098 | 74 | 0.641627 |
3e33212fab32bfdf2dbd32ad9a7af2a61fcb8c74 | 326 | py | Python | model_task_queue/__main__.py | dertilo/ml-model-deployment | 6040e02ae3b4f0717c67b7c8c6a0935c75381dbb | [
"MIT"
] | 8 | 2019-11-12T08:44:04.000Z | 2022-01-18T18:44:01.000Z | model_task_queue/__main__.py | dertilo/ml-model-deployment | 6040e02ae3b4f0717c67b7c8c6a0935c75381dbb | [
"MIT"
] | 1 | 2020-05-14T08:37:50.000Z | 2020-06-02T01:24:49.000Z | model_task_queue/__main__.py | dertilo/ml-model-deployment | 6040e02ae3b4f0717c67b7c8c6a0935c75381dbb | [
"MIT"
] | 1 | 2020-05-03T02:47:08.000Z | 2020-05-03T02:47:08.000Z | """Main entry point for the Celery worker process.
..note::
This script is here to start a worker process from the deployment package.
"""
import sys
from model_task_queue.celery import app
if __name__ == "__main__":
# starting the Celery app in worker mode
app.start(argv=['celery', 'worker'] + sys.argv... | 23.285714 | 78 | 0.705521 |
6e76c2d58ed73db329c20e5fc59a87fa685e0259 | 411 | py | Python | topgeo/__init__.py | Alan-Jairo/topgeo | 76d2a4e7eb6f182f2d64fd0047a1151cc95597c0 | [
"MIT"
] | null | null | null | topgeo/__init__.py | Alan-Jairo/topgeo | 76d2a4e7eb6f182f2d64fd0047a1151cc95597c0 | [
"MIT"
] | null | null | null | topgeo/__init__.py | Alan-Jairo/topgeo | 76d2a4e7eb6f182f2d64fd0047a1151cc95597c0 | [
"MIT"
] | null | null | null | """ Esta libreria funciona para realizar calculos topograficos
<topgeo.calcoor("argumento")> #Calcula las coordenadas (x,y,z) de un.
<topgeo.caldist("argumento")> #Calcula las distancia horizontal entre dos puntos.
<topgeo.caldist3d("argumento")> #Calculo de distancias entre dos puntos arbitrarios en x,y,z."""
from ... | 34.25 | 96 | 0.785888 |
6bc0a1503bc1d218670f7389965fb4e92f330b6b | 1,084 | py | Python | pymoo/usage/algorithms/usage_pso.py | julesy89/pymoo | f47c1a50ae9cb22c6314e4357c8807068457523d | [
"Apache-2.0"
] | 11 | 2018-05-22T17:38:02.000Z | 2022-02-28T03:34:33.000Z | pymoo/usage/algorithms/usage_pso.py | happywhy/pymoo | f47c1a50ae9cb22c6314e4357c8807068457523d | [
"Apache-2.0"
] | null | null | null | pymoo/usage/algorithms/usage_pso.py | happywhy/pymoo | f47c1a50ae9cb22c6314e4357c8807068457523d | [
"Apache-2.0"
] | 2 | 2018-05-29T21:16:52.000Z | 2021-03-26T10:10:45.000Z | from pymoo.algorithms.so_pso import PSO
from pymoo.factory import get_problem, Sphere
from pymoo.optimize import minimize
problem = get_problem("rastrigin", n_var=4)
algorithm = PSO()
ret = minimize(problem,
algorithm,
seed=1,
save_history=True,
verbose=Tru... | 26.439024 | 100 | 0.504613 |
4d0e1083dc8997ec6ee91fa8dca15cd65f07a9b2 | 1,535 | py | Python | Beginner_Day_1_14/Day7/challenge2.py | fredtheninja/100-Days-of-Code | d66b156d307c14d3b9d93559030d58294cc736bb | [
"MIT"
] | null | null | null | Beginner_Day_1_14/Day7/challenge2.py | fredtheninja/100-Days-of-Code | d66b156d307c14d3b9d93559030d58294cc736bb | [
"MIT"
] | null | null | null | Beginner_Day_1_14/Day7/challenge2.py | fredtheninja/100-Days-of-Code | d66b156d307c14d3b9d93559030d58294cc736bb | [
"MIT"
] | null | null | null | #Step 2
import random
word_list = ["aardvark", "baboon", "camel"]
chosen_word = random.choice(word_list)
#Testing code
print(f'Pssst, the solution is {chosen_word}.')
#TODO-1: - Create an empty List called display.
#For each letter in the chosen_word, add a "_" to 'display'.
#So if the chosen_word was "apple", displ... | 28.962264 | 130 | 0.672964 |
33e9801c3adbdcad532c607dcc4a63fb880ea8ef | 595 | py | Python | dashboard/src/configuration.py | rootAvish/fabric8-analytics-common | fbe36d2a9fd8bcf8ab7d78c8cdf2603ebb90dbbc | [
"Apache-2.0"
] | null | null | null | dashboard/src/configuration.py | rootAvish/fabric8-analytics-common | fbe36d2a9fd8bcf8ab7d78c8cdf2603ebb90dbbc | [
"Apache-2.0"
] | null | null | null | dashboard/src/configuration.py | rootAvish/fabric8-analytics-common | fbe36d2a9fd8bcf8ab7d78c8cdf2603ebb90dbbc | [
"Apache-2.0"
] | null | null | null | """Configuration for the Dashboard."""
from server_configuration import *
from s3_configuration import *
class Configuration():
"""Class representing configuration for the Dashboard."""
def __init__(self):
"""Construct the configuration structure."""
self.stage = ServerConfiguration('STAGE')
... | 33.055556 | 92 | 0.67395 |
9a25253f5beabb91e6ca0e63550025c17fb53093 | 1,695 | py | Python | tests/test_stream_xep_0249.py | elrond79/SleekXMPP | 62ebbe2d7c37f55fa63cbe24b2a610c1e3eb7b9f | [
"BSD-3-Clause"
] | 3 | 2019-02-01T06:50:08.000Z | 2020-03-24T00:45:31.000Z | tests/test_stream_xep_0249.py | elrond79/SleekXMPP | 62ebbe2d7c37f55fa63cbe24b2a610c1e3eb7b9f | [
"BSD-3-Clause"
] | 1 | 2017-11-07T13:03:48.000Z | 2017-11-07T13:03:48.000Z | tests/test_stream_xep_0249.py | elrond79/SleekXMPP | 62ebbe2d7c37f55fa63cbe24b2a610c1e3eb7b9f | [
"BSD-3-Clause"
] | null | null | null | import sys
import time
import threading
from sleekxmpp.test import *
from sleekxmpp.xmlstream import ElementBase
class TestStreamDirectInvite(SleekTest):
"""
Test using the XEP-0249 plugin.
"""
def tearDown(self):
self.stream_close()
def testReceiveInvite(self):
self.stream_sta... | 26.484375 | 76 | 0.506195 |
d85e1a16ab0405936a833b6c01f0694c41360e9a | 10,340 | py | Python | django_sorcery/viewsets/mixins.py | shosca/django-sorcery | 1d16c7affe7b8cc8185b7c2ff312ee13efe8f23a | [
"MIT"
] | 73 | 2018-05-04T12:44:49.000Z | 2022-02-16T23:32:04.000Z | django_sorcery/viewsets/mixins.py | shosca/django-sorcery | 1d16c7affe7b8cc8185b7c2ff312ee13efe8f23a | [
"MIT"
] | 119 | 2018-05-07T14:15:59.000Z | 2022-03-27T02:29:03.000Z | django_sorcery/viewsets/mixins.py | shosca/django-sorcery | 1d16c7affe7b8cc8185b7c2ff312ee13efe8f23a | [
"MIT"
] | 9 | 2018-08-06T18:50:09.000Z | 2021-07-30T08:01:25.000Z | """Django REST Framework like viewset mixins for common model sqlalchemy
actions."""
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponseRedirect
from django.views.generic.edit import FormMixin
from ..db import meta
from ..forms import modelform_factory
from ..views.base import... | 40.390625 | 119 | 0.568279 |
7c0c02aa7a84e445faf6a145c650699abf179de6 | 13,101 | py | Python | intersight/model/asset_service.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 5 | 2021-12-16T15:13:32.000Z | 2022-03-29T16:09:54.000Z | intersight/model/asset_service.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 4 | 2022-01-25T19:05:51.000Z | 2022-03-29T20:18:37.000Z | intersight/model/asset_service.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 2 | 2020-07-07T15:01:08.000Z | 2022-01-31T04:27:35.000Z | """
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan... | 49.437736 | 1,678 | 0.65308 |
59c611173f4e124ca2f81790f669a320a49200d6 | 6,722 | py | Python | test/util/bitcoin-util-test.py | Vidachain/Vida-Project | 92bf48e9ab6e97df2fcf79cfa2d2dabf48a31fa4 | [
"MIT"
] | null | null | null | test/util/bitcoin-util-test.py | Vidachain/Vida-Project | 92bf48e9ab6e97df2fcf79cfa2d2dabf48a31fa4 | [
"MIT"
] | null | null | null | test/util/bitcoin-util-test.py | Vidachain/Vida-Project | 92bf48e9ab6e97df2fcf79cfa2d2dabf48a31fa4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2014 BitPay Inc.
# Copyright 2016-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test framework for vida utils.
Runs automatically during `make check`.
Can a... | 37.138122 | 125 | 0.636864 |
3de32591ea0c2deb5e2537f53254346d79ae5bee | 13,281 | py | Python | loggingServer/loggingServer.py | UWCSESecurityLab/trackingExcavator | 5b946b6fef48141c5e6ca6f9e1d6977b877177ab | [
"MIT"
] | 3 | 2018-03-11T15:34:43.000Z | 2021-03-07T03:43:26.000Z | loggingServer/loggingServer.py | UWCSESecurityLab/trackingExcavator | 5b946b6fef48141c5e6ca6f9e1d6977b877177ab | [
"MIT"
] | 1 | 2021-03-07T03:51:25.000Z | 2021-03-07T03:51:25.000Z | loggingServer/loggingServer.py | UWCSESecurityLab/trackingExcavator | 5b946b6fef48141c5e6ca6f9e1d6977b877177ab | [
"MIT"
] | null | null | null | #!./venv/bin/python
"""Hammer event logging server.
Usage:
loggingServer.py [-p PORT] [--mongoport PORT] [--testing]
loggingServer.py (-h | --help)
loggingServer.py --version
Options:
-h --help Show this screen.
--version Show version.
-p --port PORT Set port to listen on.
--testing ... | 39.176991 | 114 | 0.645885 |
94ed7c5c3998120d521244e9f6c8fb67c96014f9 | 5,904 | py | Python | tests/apps/courses/test_templates_program_detail.py | leduong/richie | bf7ed379b7e2528cd790dadcec10ac2656efd189 | [
"MIT"
] | null | null | null | tests/apps/courses/test_templates_program_detail.py | leduong/richie | bf7ed379b7e2528cd790dadcec10ac2656efd189 | [
"MIT"
] | null | null | null | tests/apps/courses/test_templates_program_detail.py | leduong/richie | bf7ed379b7e2528cd790dadcec10ac2656efd189 | [
"MIT"
] | null | null | null | """
End-to-end tests for the program detail view
"""
from cms.test_utils.testcases import CMSTestCase
from richie.apps.core.factories import UserFactory
from richie.apps.courses.factories import CourseFactory, ProgramFactory
class ProgramCMSTestCase(CMSTestCase):
"""
End-to-end test suite to validate the con... | 36.670807 | 94 | 0.608062 |
25194c9be377a16a8f2b20f4ccc4cab5326f533f | 88,649 | py | Python | lib/numpy/core/tests/test_iterator.py | jamdin/jdiner-mobile-byte3 | 00f7c3b7d5ab2ad5a0660d100b4fbe91e639999b | [
"Apache-2.0"
] | 1 | 2021-05-08T14:17:47.000Z | 2021-05-08T14:17:47.000Z | lib/python2.7/numpy/core/tests/test_iterator.py | ashley8jain/IITD-complaint-system-web | 21a94601cba710f558d1689b87cfc391a1541c9f | [
"BSD-3-Clause"
] | null | null | null | lib/python2.7/numpy/core/tests/test_iterator.py | ashley8jain/IITD-complaint-system-web | 21a94601cba710f558d1689b87cfc391a1541c9f | [
"BSD-3-Clause"
] | 1 | 2015-01-21T03:15:16.000Z | 2015-01-21T03:15:16.000Z | import numpy as np
from numpy import array, arange, nditer, all
from numpy.compat import asbytes
from numpy.testing import *
import sys, warnings
import warnings
def iter_multi_index(i):
ret = []
while not i.finished:
ret.append(i.multi_index)
i.iternext()
return ret
def iter_indices(i):
... | 38.77909 | 83 | 0.527361 |
a630ce2177bb50885d99c5a2321bfd8928436db7 | 2,262 | py | Python | ucsmsdk/mometa/vnic/VnicDynamicProvider.py | thinkitdata/ucsmsdk | da6599e1dbc1207a30eabe548a7e5791af5f476b | [
"Apache-2.0"
] | null | null | null | ucsmsdk/mometa/vnic/VnicDynamicProvider.py | thinkitdata/ucsmsdk | da6599e1dbc1207a30eabe548a7e5791af5f476b | [
"Apache-2.0"
] | null | null | null | ucsmsdk/mometa/vnic/VnicDynamicProvider.py | thinkitdata/ucsmsdk | da6599e1dbc1207a30eabe548a7e5791af5f476b | [
"Apache-2.0"
] | null | null | null | """This module contains the general information for VnicDynamicProvider ManagedObject."""
from ...ucsmo import ManagedObject
from ...ucscoremeta import MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class VnicDynamicProviderConsts:
pass
class VnicDynamicProvider(ManagedObject):
"""This is VnicDy... | 49.173913 | 248 | 0.651636 |
50c7ddc1138ab1227cab195d3bca4e084d8026eb | 1,961 | py | Python | Dictator_service/stopper_ex.py | FurqanKhan1/Dictator | 74e29c12a8f92292ab3275661622c0632cdd0a7b | [
"Unlicense"
] | 5 | 2019-03-14T10:17:22.000Z | 2019-10-23T14:04:12.000Z | Dictator_service/stopper_ex.py | FurqanKhan1/Dictator | 74e29c12a8f92292ab3275661622c0632cdd0a7b | [
"Unlicense"
] | null | null | null | Dictator_service/stopper_ex.py | FurqanKhan1/Dictator | 74e29c12a8f92292ab3275661622c0632cdd0a7b | [
"Unlicense"
] | 14 | 2019-03-14T10:34:02.000Z | 2021-10-31T17:34:13.000Z | """
@Author :Furqan Khan
@Email :furqankhan08@gmail.com
@Date :1/2/2017
Objective :
The purpose of this file /module /Class is to stop an on going vulneraibility discovery scan
It will take the process id from the web service which would inturn get the id from the project id
and will then kill the process with rec... | 21.315217 | 98 | 0.722591 |
5e817c0d340ad65ea8fa74f231442c338d513ad1 | 2,304 | py | Python | asistance/classrooms/migrations/0001_initial.py | Daniel1404/Registration-program | 42dbe8871915b7b6f5be8ce173870f75ef0d79bf | [
"MIT"
] | null | null | null | asistance/classrooms/migrations/0001_initial.py | Daniel1404/Registration-program | 42dbe8871915b7b6f5be8ce173870f75ef0d79bf | [
"MIT"
] | null | null | null | asistance/classrooms/migrations/0001_initial.py | Daniel1404/Registration-program | 42dbe8871915b7b6f5be8ce173870f75ef0d79bf | [
"MIT"
] | null | null | null | # Generated by Django 3.1.8 on 2021-04-27 00:10
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 47.020408 | 161 | 0.610677 |
867167a80255353cc88b2d4e6b46cd7459d15389 | 2,256 | py | Python | jmetal/algorithm/multiobjective/random_search.py | 12yuens2/jMetalPy | 6f54940cb205df831f5498e2eac2520b331ee4fd | [
"MIT"
] | 335 | 2017-03-16T19:44:50.000Z | 2022-03-30T08:50:46.000Z | jmetal/algorithm/multiobjective/random_search.py | 12yuens2/jMetalPy | 6f54940cb205df831f5498e2eac2520b331ee4fd | [
"MIT"
] | 85 | 2017-05-16T06:40:51.000Z | 2022-02-05T23:43:49.000Z | jmetal/algorithm/multiobjective/random_search.py | 12yuens2/jMetalPy | 6f54940cb205df831f5498e2eac2520b331ee4fd | [
"MIT"
] | 130 | 2017-02-08T01:19:15.000Z | 2022-03-25T08:32:08.000Z | import time
from typing import TypeVar, List
from jmetal.config import store
from jmetal.core.algorithm import Algorithm
from jmetal.core.problem import Problem
from jmetal.util.archive import NonDominatedSolutionsArchive
from jmetal.util.termination_criterion import TerminationCriterion
S = TypeVar('S')
R = TypeVar(... | 30.90411 | 105 | 0.688387 |
63210f74747ed229d0585ece5310887523cd500f | 1,441 | py | Python | splitData.py | renhaocui/activityExtractor | f5abaff28bb84af3af3a7268729541af6fa25f36 | [
"MIT"
] | 1 | 2019-09-18T16:39:00.000Z | 2019-09-18T16:39:00.000Z | splitData.py | renhaocui/activityExtractor | f5abaff28bb84af3af3a7268729541af6fa25f36 | [
"MIT"
] | 1 | 2019-09-18T19:40:35.000Z | 2019-09-18T19:40:35.000Z | splitData.py | renhaocui/activityExtractor | f5abaff28bb84af3af3a7268729541af6fa25f36 | [
"MIT"
] | null | null | null | import random
def split(modelName, extractIndex):
dataFile = open('data/consolidateData_' + modelName + '.json', 'r')
devFile = open('data/consolidateData_'+modelName+'_dev.json', 'w')
expFile = open('data/consolidateData_'+modelName+'_exp.json', 'w')
for index, line in enumerate(dataFile):
if ... | 27.711538 | 71 | 0.559334 |
b6c090feee98e12b3b498e7b535c182cc51a3ef4 | 32,676 | py | Python | neutron/agent/dhcp/agent.py | hashsos/hashcloudos-neutron | 76ec5ca105043be6bf7220b5c5684190ddf14952 | [
"Apache-2.0"
] | null | null | null | neutron/agent/dhcp/agent.py | hashsos/hashcloudos-neutron | 76ec5ca105043be6bf7220b5c5684190ddf14952 | [
"Apache-2.0"
] | null | null | null | neutron/agent/dhcp/agent.py | hashsos/hashcloudos-neutron | 76ec5ca105043be6bf7220b5c5684190ddf14952 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 42.657963 | 79 | 0.613019 |
fad36debd897abfcd6c8095ff2a7295299b47462 | 4,536 | gyp | Python | libyuv_test.gyp | Shamim1977/libyuv | 9bccdc406f290fc02ac787f8c8d13aacbd750241 | [
"BSD-3-Clause"
] | 80 | 2015-05-06T14:37:36.000Z | 2019-01-01T05:53:59.000Z | libyuv_test.gyp | Shamim1977/libyuv | 9bccdc406f290fc02ac787f8c8d13aacbd750241 | [
"BSD-3-Clause"
] | 3 | 2020-10-26T09:37:42.000Z | 2021-05-11T00:46:16.000Z | libyuv_test.gyp | Shamim1977/libyuv | 9bccdc406f290fc02ac787f8c8d13aacbd750241 | [
"BSD-3-Clause"
] | 43 | 2015-04-21T09:56:28.000Z | 2019-01-10T08:22:07.000Z | # Copyright 2011 The LibYuv Project Authors. All rights reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors... | 25.772727 | 79 | 0.496473 |
212c2b117bdfbeb0cb65957d3e0debc5ba1628d8 | 304 | py | Python | Hello world python/helloRandom.py | saurabhcommand/Hello-world | 647bad9da901a52d455f05ecc37c6823c22dc77e | [
"MIT"
] | 1,428 | 2018-10-03T15:15:17.000Z | 2019-03-31T18:38:36.000Z | Hello world python/helloRandom.py | saurabhcommand/Hello-world | 647bad9da901a52d455f05ecc37c6823c22dc77e | [
"MIT"
] | 1,162 | 2018-10-03T15:05:49.000Z | 2018-10-18T14:17:52.000Z | Hello world python/helloRandom.py | saurabhcommand/Hello-world | 647bad9da901a52d455f05ecc37c6823c22dc77e | [
"MIT"
] | 3,909 | 2018-10-03T15:07:19.000Z | 2019-03-31T18:39:08.000Z | print ("Hello World?")
import random
helloWorld = random.randint(1,2)
randomChoice = 0
while randomChoice < 1 or randomChoice > 2:
randomChoice = int(input("Choose 1 or 2: "))
print ("You chose number ", randomChoice)
if randomChoice == helloWorld:
print ("Hello World!")
else:
print ("Hi World.")
| 25.333333 | 46 | 0.703947 |
f6ee44a05416a207c7872447845493809345588e | 354 | py | Python | tests/unit/test_parser.py | ralphribeiro/facilita-DOU | e695ac0f58369d61fad2723bd5e52ecd80d0b33f | [
"MIT"
] | null | null | null | tests/unit/test_parser.py | ralphribeiro/facilita-DOU | e695ac0f58369d61fad2723bd5e52ecd80d0b33f | [
"MIT"
] | null | null | null | tests/unit/test_parser.py | ralphribeiro/facilita-DOU | e695ac0f58369d61fad2723bd5e52ecd80d0b33f | [
"MIT"
] | null | null | null | from os.path import dirname, join
from xml.etree.ElementTree import Element
from src.app.parser_xml import parse_xml
def get_xml_file_path():
return join(dirname(__file__), 'parser_data_test.xml')
def test_find_in_xml_given_path():
xml = get_xml_file_path()
response = parse_xml(xml, 'saúde')
assert... | 22.125 | 58 | 0.757062 |
ffb0dafeefebf00b801fa478007af6fa732c50ff | 1,661 | py | Python | BacterialTyper/other_tools/tools.py | HCGB-IGTP/BacterialTyper | 215e29a0381d4ae616cf0a6462a04117dc30e293 | [
"MIT"
] | 2 | 2021-03-11T08:50:06.000Z | 2021-12-16T14:35:37.000Z | BacterialTyper/other_tools/tools.py | HCGB-IGTP/BacterialTyper | 215e29a0381d4ae616cf0a6462a04117dc30e293 | [
"MIT"
] | 5 | 2021-06-15T11:49:26.000Z | 2022-03-12T00:58:37.000Z | BacterialTyper/other_tools/tools.py | HCGB-IGTP/BacterialTyper | 215e29a0381d4ae616cf0a6462a04117dc30e293 | [
"MIT"
] | null | null | null | #usr/bin/en python3
##########################################################
## Jose F. Sanchez ##
## Copyright (C) 2019 Lauro Sumoy Lab, IGTP, Spain ##
##########################################################
"""
Retrieves files within ``other_tools`` directory and returns path to given script spec... | 31.942308 | 92 | 0.584588 |
2facc946bf31500bad938d91073de6708e99bf21 | 1,872 | py | Python | server/tests/api/test_user_api.py | Synergize-Southwest-Detroit/api | 78a1f1da80e3b3e506fbeb84f477bcc2d54377a4 | [
"MIT"
] | 2 | 2015-03-19T14:23:46.000Z | 2015-03-19T14:23:51.000Z | server/tests/api/test_user_api.py | bnotified/api | 02a7eeff19f910b85b0144b6364a7f5ccd80986f | [
"MIT"
] | null | null | null | server/tests/api/test_user_api.py | bnotified/api | 02a7eeff19f910b85b0144b6364a7f5ccd80986f | [
"MIT"
] | null | null | null | import json
from server.tests.helpers import FlaskTestCase, fixtures
class TestUserAPI(FlaskTestCase):
@fixtures('base.json')
def test_get_empty_users(self):
"""Test GET /api/users endpoint with no data"""
response, data = self.api_request('get', '/api/users')
assert data['num_results... | 33.428571 | 67 | 0.612179 |
3228487a3d28d98ce8aa5e93ba563020d3330261 | 1,183 | py | Python | supervised_learning/0x06-keras/1-input.py | cbarros7/holbertonschool-machine_learning | 1edb4c253441f6319b86c9c590d1e7dd3fc32bf4 | [
"MIT"
] | 1 | 2022-03-09T19:12:22.000Z | 2022-03-09T19:12:22.000Z | supervised_learning/0x06-keras/1-input.py | cbarros7/holbertonschool-machine_learning | 1edb4c253441f6319b86c9c590d1e7dd3fc32bf4 | [
"MIT"
] | null | null | null | supervised_learning/0x06-keras/1-input.py | cbarros7/holbertonschool-machine_learning | 1edb4c253441f6319b86c9c590d1e7dd3fc32bf4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Input - use the Input class"""
import tensorflow.keras as K
def build_model(nx, layers, activations, lambtha, keep_prob):
"""build_model: builds a neural network
with the Keras library
Args:
nx : is the number of input features to the network
... | 34.794118 | 67 | 0.609467 |
c84146336e08ae5858bd17c14101050e53f626e2 | 9,626 | py | Python | bountyfulcoinsapp/migrations/0001_initial.py | bountyful/bountyfulcoins | 9a909b42867407ea5122efff469a7b909bd52944 | [
"MIT"
] | null | null | null | bountyfulcoinsapp/migrations/0001_initial.py | bountyful/bountyfulcoins | 9a909b42867407ea5122efff469a7b909bd52944 | [
"MIT"
] | 1 | 2015-01-11T08:13:44.000Z | 2015-01-11T08:13:44.000Z | bountyfulcoinsapp/migrations/0001_initial.py | bountyful/bountyfulcoins | 9a909b42867407ea5122efff469a7b909bd52944 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Link'
db.create_table(u'bountyfulcoinsapp_link', (
... | 56.292398 | 195 | 0.581654 |
55d7ba7f244d393705a44230486455d6331f6429 | 111 | py | Python | text_parser.py | sonhal/python-course-b-code | 2fdb21adcd2e6517e51735fad1d2fc7739ddadfa | [
"MIT"
] | null | null | null | text_parser.py | sonhal/python-course-b-code | 2fdb21adcd2e6517e51735fad1d2fc7739ddadfa | [
"MIT"
] | null | null | null | text_parser.py | sonhal/python-course-b-code | 2fdb21adcd2e6517e51735fad1d2fc7739ddadfa | [
"MIT"
] | null | null | null | import my_functions
print(my_functions.letter_counter("sdasdasd", "a"))
print(my_functions.letter_counter(1))
| 22.2 | 51 | 0.810811 |
80fdb36aa4122911d11cb6a6548337007c221704 | 36,999 | py | Python | python/svg.py | Lauren-Nilsson/capsid-souffle-1 | 7afeb43c2649f32be0395699192d8ea4a7d2a6d9 | [
"BSD-3-Clause"
] | null | null | null | python/svg.py | Lauren-Nilsson/capsid-souffle-1 | 7afeb43c2649f32be0395699192d8ea4a7d2a6d9 | [
"BSD-3-Clause"
] | 2 | 2020-03-06T15:44:27.000Z | 2020-03-06T15:44:38.000Z | python/svg.py | Lauren-Nilsson/capsid-souffle-1 | 7afeb43c2649f32be0395699192d8ea4a7d2a6d9 | [
"BSD-3-Clause"
] | 3 | 2020-03-05T20:46:04.000Z | 2020-06-09T22:28:19.000Z | # Pizza.py toolkit, www.cs.sandia.gov/~sjplimp/pizza.html
# Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories
#
# Copyright (2005) Sandia Corporation. Under the terms of Contract
# DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
# certain rights in this software. This software is... | 33.064343 | 131 | 0.422174 |
b8f7578456df1268c8a57e94dab5c15718712ca2 | 405 | py | Python | graph_tutorial/graph_tutorial/wsgi.py | jasonjoh/python-django | 42743635b4376d9393177c1e6bb92cb55ae44560 | [
"MIT"
] | null | null | null | graph_tutorial/graph_tutorial/wsgi.py | jasonjoh/python-django | 42743635b4376d9393177c1e6bb92cb55ae44560 | [
"MIT"
] | null | null | null | graph_tutorial/graph_tutorial/wsgi.py | jasonjoh/python-django | 42743635b4376d9393177c1e6bb92cb55ae44560 | [
"MIT"
] | null | null | null | """
WSGI config for graph_tutorial project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANG... | 23.823529 | 78 | 0.792593 |
5db94b1c48c73bcaba5c54f442c88128edf83127 | 944 | py | Python | setup.py | lugensa/js.spiffform | c86fd6a28d2eb36a3bec63a926d4e71beacd5501 | [
"BSD-3-Clause"
] | 1 | 2020-07-28T20:18:37.000Z | 2020-07-28T20:18:37.000Z | setup.py | lugensa/js.spiffform | c86fd6a28d2eb36a3bec63a926d4e71beacd5501 | [
"BSD-3-Clause"
] | null | null | null | setup.py | lugensa/js.spiffform | c86fd6a28d2eb36a3bec63a926d4e71beacd5501 | [
"BSD-3-Clause"
] | 1 | 2020-04-21T11:38:46.000Z | 2020-04-21T11:38:46.000Z | from setuptools import setup, find_packages
import os
version = '1.3.3.dev0'
def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
long_description = (
read('README.txt')
+ '\n' +
read('js', 'spiffform', 'test_spiffform.txt')
+ '\n' +
read('CHANGES.txt'))
s... | 21.953488 | 72 | 0.595339 |
fcdad3ae927c3470a3e5b56220d0ae820a79af9d | 1,382 | py | Python | recipes/admin.py | ilyukevich/foodgram-project | 458b01d6696687ff6476a8da343da3590699558f | [
"MIT"
] | null | null | null | recipes/admin.py | ilyukevich/foodgram-project | 458b01d6696687ff6476a8da343da3590699558f | [
"MIT"
] | null | null | null | recipes/admin.py | ilyukevich/foodgram-project | 458b01d6696687ff6476a8da343da3590699558f | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.db.models import Count
from recipes.models import (Favorite, Follow, Ingredient, Recipe,
RecipeIngredient, ShoppingList)
class RecipeIngredientInline(admin.TabularInline):
model = RecipeIngredient
min_num = 1
@admin.register(Recipe)
c... | 24.678571 | 71 | 0.710564 |
6d41abdc303c95148618e974ecfac45a868705be | 1,311 | py | Python | leaf_demo/scripts/moveit_fk_demo.py | Xueming10wu/Leaf_robot_ros | c248d90588f317fbd81e4943ae2926836937c84a | [
"MIT"
] | 6 | 2020-01-25T10:15:12.000Z | 2021-07-13T02:34:43.000Z | leaf_demo/scripts/moveit_fk_demo.py | Xueming10wu/Leaf_robot_ros | c248d90588f317fbd81e4943ae2926836937c84a | [
"MIT"
] | null | null | null | leaf_demo/scripts/moveit_fk_demo.py | Xueming10wu/Leaf_robot_ros | c248d90588f317fbd81e4943ae2926836937c84a | [
"MIT"
] | 1 | 2021-07-02T08:39:02.000Z | 2021-07-02T08:39:02.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import rospy, sys
import moveit_commander
class MoveItFkDemo:
def __init__(self):
# 初始化move_group的API
moveit_commander.roscpp_initialize(sys.argv)
# 初始化ROS节点
rospy.init_node('moveit_fk_demo', anonymous=True)
# 初始化需要使用move gro... | 25.705882 | 83 | 0.60717 |
a999c1ff52f6da8e461c19080e3d40b3c3c1620d | 1,563 | py | Python | imbi/endpoints/ui/automations/sonarqube.py | nvllsvm/imbi-api | 1a5bd8894ac14c1026f33297994aa10782b0eea0 | [
"BSD-3-Clause"
] | 1 | 2021-06-23T18:34:47.000Z | 2021-06-23T18:34:47.000Z | imbi/endpoints/ui/automations/sonarqube.py | nvllsvm/imbi-api | 1a5bd8894ac14c1026f33297994aa10782b0eea0 | [
"BSD-3-Clause"
] | null | null | null | imbi/endpoints/ui/automations/sonarqube.py | nvllsvm/imbi-api | 1a5bd8894ac14c1026f33297994aa10782b0eea0 | [
"BSD-3-Clause"
] | 2 | 2022-02-11T22:06:18.000Z | 2022-02-21T19:35:06.000Z | """
API Endpoint for returning UI Settings
"""
import yarl
from imbi import errors
from imbi.automations import sonarqube
from imbi.endpoints import base
from imbi.endpoints.ui.automations import mixins
class CreationRequestHandler(mixins.PrepareFailureMixin,
base.AuthenticatedRequestHa... | 35.522727 | 78 | 0.610365 |
8f68a951338f69400bd5aca2f23151b2019b54e9 | 1,521 | py | Python | driver.py | srinjoychakravarty/google_drive_scraper | 2ffea2b875b360d8a7257a5e8d169548b874b759 | [
"MIT"
] | null | null | null | driver.py | srinjoychakravarty/google_drive_scraper | 2ffea2b875b360d8a7257a5e8d169548b874b759 | [
"MIT"
] | null | null | null | driver.py | srinjoychakravarty/google_drive_scraper | 2ffea2b875b360d8a7257a5e8d169548b874b759 | [
"MIT"
] | null | null | null | from selenium import webdriver
import time
from pynput.keyboard import Key, Controller
def scraper(pages, url):
driver = webdriver.Firefox()
driver.get(url)
time.sleep(6)
keyboard = Controller()
for x in range(pages):
keyboard.press(Key.page_down)
keyboard.release(Key.page_down)
javaScript = """let jspdf = d... | 29.25 | 81 | 0.635108 |
c55bd3ce8e636a0b631e3c68aa6cdc04c45177ae | 2,626 | py | Python | salt/sdb/vault.py | springborland/salt | bee85e477d57e9a171884e54fefb9a59d0835ed0 | [
"Apache-2.0"
] | 1 | 2020-04-09T03:25:10.000Z | 2020-04-09T03:25:10.000Z | salt/sdb/vault.py | springborland/salt | bee85e477d57e9a171884e54fefb9a59d0835ed0 | [
"Apache-2.0"
] | null | null | null | salt/sdb/vault.py | springborland/salt | bee85e477d57e9a171884e54fefb9a59d0835ed0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Vault SDB Module
:maintainer: SaltStack
:maturity: New
:platform: all
.. versionadded:: 2016.11.0
This module allows access to Hashicorp Vault using an ``sdb://`` URI.
Base configuration instructions are documented in the execution module docs.
Below are noted extra configur... | 27.072165 | 83 | 0.66032 |
81e6df6b1f9eedef8b16a2cc29470999fc6b92b2 | 2,308 | py | Python | src/main/antlrParser/LanguageParser.py | alschmut/code2semantics | af1daf0b8320b534344c5352ae972fb600e21e43 | [
"MIT"
] | 2 | 2020-02-26T22:50:38.000Z | 2020-10-29T10:46:10.000Z | src/main/antlrParser/LanguageParser.py | alschmut/linguistic-parser | af1daf0b8320b534344c5352ae972fb600e21e43 | [
"MIT"
] | null | null | null | src/main/antlrParser/LanguageParser.py | alschmut/linguistic-parser | af1daf0b8320b534344c5352ae972fb600e21e43 | [
"MIT"
] | null | null | null | from antlr4 import CommonTokenStream, ParseTreeWalker, InputStream
from antlrParser.Language import Language
from antlrParser.Language import Language
from antlrParser.Java.JavaLexer import JavaLexer
from antlrParser.Java.JavaParser import JavaParser
from antlrParser.ExtendedListener.JavaParserListenerExtended import ... | 41.214286 | 98 | 0.753899 |
294ecf72e433e981a0544ae2e1c524d8432775d2 | 4,830 | py | Python | models/spa_softmax_v5.py | facexteam/pytorch-cifar | 48abfba662dc41b6f35b70f54f543af658f56be8 | [
"MIT"
] | 1 | 2019-02-19T09:23:26.000Z | 2019-02-19T09:23:26.000Z | models/spa_softmax_v5.py | facexteam/pytorch-cifar | 48abfba662dc41b6f35b70f54f543af658f56be8 | [
"MIT"
] | null | null | null | models/spa_softmax_v5.py | facexteam/pytorch-cifar | 48abfba662dc41b6f35b70f54f543af658f56be8 | [
"MIT"
] | 1 | 2019-02-19T09:23:30.000Z | 2019-02-19T09:23:30.000Z | '''Large margin softmax in PyTorch.
@author: zhaoyafei
'''
from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
class SpaSoftmax_v5(nn.Module):
def __init__(self, embedding_net, output_size=10, scale=16, m=30):
super(SpaSoftmax_v5, se... | 31.776316 | 78 | 0.547205 |
535f9c730fe463d6e83a74b80b6351e137f0514e | 725 | py | Python | backend/base/views/product_views.py | drcan94/Dj-React-eCommerce | 498395c2f03528bce8348e5f0aa88221a01b9df8 | [
"MIT"
] | 1 | 2022-01-08T14:11:03.000Z | 2022-01-08T14:11:03.000Z | backend/base/views/product_views.py | drcan94/Dj-React-eCommerce | 498395c2f03528bce8348e5f0aa88221a01b9df8 | [
"MIT"
] | null | null | null | backend/base/views/product_views.py | drcan94/Dj-React-eCommerce | 498395c2f03528bce8348e5f0aa88221a01b9df8 | [
"MIT"
] | null | null | null | # from django.shortcuts import render
from rest_framework.decorators import api_view, permission_classes
from rest_framework.permissions import IsAdminUser, IsAuthenticated
from rest_framework.response import Response
from rest_framework.status import (
HTTP_400_BAD_REQUEST,
)
from base.models import Product
from... | 29 | 67 | 0.788966 |
fe8a0e2a9ddc0a0e9ede58870c874a446d086c1a | 143 | py | Python | fsetools/tests/test_libstd_ec_1991_1_2.py | fsepy/fsetools | 6b6c647912551680109a84d8640b9cfbe7970970 | [
"Apache-2.0"
] | 1 | 2020-02-25T21:47:56.000Z | 2020-02-25T21:47:56.000Z | fsetools/tests/test_libstd_ec_1991_1_2.py | fsepy/fsetools | 6b6c647912551680109a84d8640b9cfbe7970970 | [
"Apache-2.0"
] | 12 | 2020-02-24T10:10:57.000Z | 2020-09-18T11:18:08.000Z | fsetools/tests/test_libstd_ec_1991_1_2.py | fsepy/fsetools | 6b6c647912551680109a84d8640b9cfbe7970970 | [
"Apache-2.0"
] | null | null | null | from fsetools.libstd.ec_1991_1_2 import _test_appendix_a_parametric_fire as test_appendix_a_parametric_fire
test_appendix_a_parametric_fire()
| 35.75 | 107 | 0.916084 |
e89ab8b9fbe0d3f33c1003d5f44dfe92fe0a8be1 | 2,417 | py | Python | init_order_master.py | cathleya/mycat | 9a39614f13dd1894bc2d9d8fff417b524d1ecf8b | [
"Apache-2.0"
] | null | null | null | init_order_master.py | cathleya/mycat | 9a39614f13dd1894bc2d9d8fff417b524d1ecf8b | [
"Apache-2.0"
] | null | null | null | init_order_master.py | cathleya/mycat | 9a39614f13dd1894bc2d9d8fff417b524d1ecf8b | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
#用途:用于初始化order_master数据
#
import MySQLdb,string,sys
from faker import Faker
reload(sys)
sys.setdefaultencoding('utf-8')
try:
conn = MySQLdb.connect(host ='127.0.0.1',port=3306,user ='root',passwd = '123456',db = 'imooc_db',charset="utf8")
cursor = conn.... | 32.226667 | 128 | 0.68101 |
8f431d27ed7a3bd50ee468c4b102d3e654603891 | 449 | py | Python | data/scripts/templates/object/mobile/shared_darklight_guard.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/mobile/shared_darklight_guard.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/mobile/shared_darklight_guard.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_darklight_guard.iff"
result.attribute_template_id = 9
result.... | 26.411765 | 61 | 0.732739 |
a9ec139a59a4658d01d8fd047fa884adc7029414 | 1,513 | py | Python | Spatial-CNN/utilis.py | Tilix4/ViDeNN | 8452db57e5bf2aa8ce6999e6d285417716805a6a | [
"MIT"
] | 171 | 2019-04-16T07:41:03.000Z | 2022-03-22T11:20:24.000Z | Spatial-CNN/utilis.py | Tilix4/ViDeNN | 8452db57e5bf2aa8ce6999e6d285417716805a6a | [
"MIT"
] | 24 | 2019-04-24T14:45:24.000Z | 2022-02-22T12:22:59.000Z | Spatial-CNN/utilis.py | Tilix4/ViDeNN | 8452db57e5bf2aa8ce6999e6d285417716805a6a | [
"MIT"
] | 34 | 2019-04-29T15:37:08.000Z | 2022-01-26T13:53:03.000Z | # -*- coding: utf-8 -*-
"""
Created on Thu May 30 14:32:05 2019
@author: clausmichele
"""
import gc
import os
import sys
import numpy as np
import tensorflow as tf
import cv2
def data_augmentation(image, mode):
if mode == 0:
# original
return image
elif mode == 1:
# flip up and down
return np.flipud(image... | 20.173333 | 57 | 0.675479 |
d41ce1c3eddba60289d171457111994e17db5cfe | 2,430 | py | Python | var/spack/repos/builtin/packages/intel-oneapi-dpl/package.py | renjithravindrankannath/spack | 043b2cbb7c99d69a373f3ecbf35bc3b4638bcf85 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/intel-oneapi-dpl/package.py | renjithravindrankannath/spack | 043b2cbb7c99d69a373f3ecbf35bc3b4638bcf85 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/intel-oneapi-dpl/package.py | renjithravindrankannath/spack | 043b2cbb7c99d69a373f3ecbf35bc3b4638bcf85 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import platform
from spack.package import *
@IntelOneApiPackage.update_description
class IntelOneapiDpl(IntelOneApiLib... | 41.896552 | 123 | 0.683951 |
2c2365714cdd12cc597645773769a037a567e0c1 | 958 | py | Python | procurebd_api/serializers.py | FarishtaJayas/HackNSU-2.0 | c49fe1d57cc512266e1208eb8ad6d62ddbac8743 | [
"MIT"
] | null | null | null | procurebd_api/serializers.py | FarishtaJayas/HackNSU-2.0 | c49fe1d57cc512266e1208eb8ad6d62ddbac8743 | [
"MIT"
] | null | null | null | procurebd_api/serializers.py | FarishtaJayas/HackNSU-2.0 | c49fe1d57cc512266e1208eb8ad6d62ddbac8743 | [
"MIT"
] | 1 | 2020-10-04T06:35:37.000Z | 2020-10-04T06:35:37.000Z | from rest_framework import serializers
from procurebd_api.models import *
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = ProfileUser
#fields = ('name', 'ranking')
fields = '__all__'
class ItemSerializer(serializers.ModelSerializer):
... | 18.784314 | 57 | 0.591858 |
4b33213d85abb3162e64671d08cda07fc86474e4 | 573 | py | Python | CAP4-Case study_interface design/exercise&solutions/exercise_4_1.py | falble/mythinkpython2 | 25de15c8657f32a8f85189d9cb0588c816e9e7d3 | [
"Apache-2.0"
] | 1 | 2020-11-20T16:28:32.000Z | 2020-11-20T16:28:32.000Z | CAP4-Case study_interface design/exercise&solutions/exercise_4_1.py | falble/mythinkpython2 | 25de15c8657f32a8f85189d9cb0588c816e9e7d3 | [
"Apache-2.0"
] | null | null | null | CAP4-Case study_interface design/exercise&solutions/exercise_4_1.py | falble/mythinkpython2 | 25de15c8657f32a8f85189d9cb0588c816e9e7d3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Feb 16 17:19:01 2019
@author: Utente
"""
#Chapter 4 - Case study: interface design
#Exercise 4.1
import turtle
import math
bob = turtle.Turtle()
print(bob)
def arc(t, r, angle): #copy poligon and transform it into arc
... | 21.222222 | 97 | 0.544503 |
a96bab53f9bfe9c64409f17a958af8043585e239 | 569 | py | Python | mcfunction/versions/mc_1_8/kill.py | Le0Developer/mcast | bdabd897e399ff17c734b9e02d3e1e5099674a1c | [
"MIT"
] | 2 | 2021-12-28T14:10:13.000Z | 2022-01-12T16:59:20.000Z | mcfunction/versions/mc_1_8/kill.py | Le0Developer/mcast | bdabd897e399ff17c734b9e02d3e1e5099674a1c | [
"MIT"
] | 11 | 2021-01-18T09:00:23.000Z | 2021-01-29T09:29:04.000Z | mcfunction/versions/mc_1_8/kill.py | Le0Developer/mcast | bdabd897e399ff17c734b9e02d3e1e5099674a1c | [
"MIT"
] | null | null | null |
from dataclasses import dataclass
from .. import Command, ParsedCommand, Parser
from ...nodes import EntityNode
from ...parser_types import Entity
@dataclass()
class ParsedKillCommand(ParsedCommand):
command: str
target: EntityNode = None
def __str__(self):
if self.target is not None:
... | 18.966667 | 50 | 0.683656 |
1c397d8363d117e09f5dbcb061e7fc8351cacae5 | 1,040 | py | Python | mys/transpiler/variables.py | Dogeek/mys | 193259a634c3ab1d9058b9ff79a0462ae86274b7 | [
"MIT"
] | null | null | null | mys/transpiler/variables.py | Dogeek/mys | 193259a634c3ab1d9058b9ff79a0462ae86274b7 | [
"MIT"
] | null | null | null | mys/transpiler/variables.py | Dogeek/mys | 193259a634c3ab1d9058b9ff79a0462ae86274b7 | [
"MIT"
] | null | null | null | class Variables:
"""A class that keeps track of which variables that are defined in all
branches, so that they can be used once they converges.
"""
def __init__(self):
self._first_add = True
self._local_variables = {}
def add_branch(self, variables):
"""Add all variables d... | 26 | 75 | 0.573077 |
197b8ba36ed8849bbed46800a0681b627505748e | 2,124 | py | Python | bin/libarg.py | mmajewsk/larcv2 | 9ee74e42b293d547d3a8510fa2139b2d4ccf6b89 | [
"MIT"
] | null | null | null | bin/libarg.py | mmajewsk/larcv2 | 9ee74e42b293d547d3a8510fa2139b2d4ccf6b89 | [
"MIT"
] | null | null | null | bin/libarg.py | mmajewsk/larcv2 | 9ee74e42b293d547d3a8510fa2139b2d4ccf6b89 | [
"MIT"
] | null | null | null | import sys,os
if sys.version_info.major == 3:
import subprocess
dirs=[]
for d in os.listdir(os.environ['LARCV_BUILDDIR']):
if not len([x for x in os.listdir('%s/%s' % (os.environ['LARCV_BUILDDIR'],d)) if x.endswith('.o')]): continue
dirs.append(d)
libs=[x for x in subprocess.getoutput('... | 30.342857 | 117 | 0.617702 |
2b14c3e65337433fba3899cb6355d0799f23aedd | 57,612 | py | Python | OneTrack/MAIN/UI/__init__.py | aragubas/OneTrack | d246138b8dde531e2c30862fe1c774aeb7c848c0 | [
"Apache-2.0"
] | null | null | null | OneTrack/MAIN/UI/__init__.py | aragubas/OneTrack | d246138b8dde531e2c30862fe1c774aeb7c848c0 | [
"Apache-2.0"
] | 1 | 2020-11-02T01:46:16.000Z | 2020-11-02T01:46:16.000Z | OneTrack/MAIN/UI/__init__.py | aragubas/OneTrack | d246138b8dde531e2c30862fe1c774aeb7c848c0 | [
"Apache-2.0"
] | 1 | 2020-11-02T01:35:13.000Z | 2020-11-02T01:35:13.000Z | #!/usr/bin/python3.7
# Copyright 2020 Aragubas
#
# 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... | 40.119777 | 326 | 0.598452 |
de839f71bc0986bf420b20d4eb23a89e6162064d | 4,281 | py | Python | ptbaselines/common/tests/test_serialization.py | KongCDY/baselines_pytorch | 26c1a9e7829aad88eb725f79c401fe9d108803bf | [
"MIT"
] | null | null | null | ptbaselines/common/tests/test_serialization.py | KongCDY/baselines_pytorch | 26c1a9e7829aad88eb725f79c401fe9d108803bf | [
"MIT"
] | null | null | null | ptbaselines/common/tests/test_serialization.py | KongCDY/baselines_pytorch | 26c1a9e7829aad88eb725f79c401fe9d108803bf | [
"MIT"
] | null | null | null | import os
import gym
import tempfile
import pytest
import tensorflow as tf
import numpy as np
from ptbaselines.common.tests.envs.mnist_env import MnistEnv
from ptbaselines.common.vec_env.dummy_vec_env import DummyVecEnv
from ptbaselines.run import get_learn_function
from ptbaselines.common.tf_util import make_session,... | 30.578571 | 105 | 0.655454 |
3c5ec0dcd06d002bde7a76a013113eb4945b1bf2 | 2,158 | py | Python | migrations/versions/f1a57923ac9d_.py | CsarChvz/SkyTools | 1a451bf905946054c55849f4fc9291df0627e213 | [
"MIT"
] | null | null | null | migrations/versions/f1a57923ac9d_.py | CsarChvz/SkyTools | 1a451bf905946054c55849f4fc9291df0627e213 | [
"MIT"
] | null | null | null | migrations/versions/f1a57923ac9d_.py | CsarChvz/SkyTools | 1a451bf905946054c55849f4fc9291df0627e213 | [
"MIT"
] | null | null | null | """empty message
Revision ID: f1a57923ac9d
Revises: 40dc1de28dc3
Create Date: 2021-07-12 14:04:13.845151
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f1a57923ac9d'
down_revision = '40dc1de28dc3'
branch_labels = None
depends_on = None
def upgrade():
# ... | 39.236364 | 91 | 0.68304 |
33d07ee13bc957eaf545d450de1da3180c75c365 | 1,006 | py | Python | backend/utils/authenticators.py | YouFacai/iWiki | 7a2cbb514f25b72932b0212f6165cdb426243243 | [
"MIT"
] | null | null | null | backend/utils/authenticators.py | YouFacai/iWiki | 7a2cbb514f25b72932b0212f6165cdb426243243 | [
"MIT"
] | null | null | null | backend/utils/authenticators.py | YouFacai/iWiki | 7a2cbb514f25b72932b0212f6165cdb426243243 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.core.cache import cache
from rest_framework.authentication import BaseAuthentication, SessionAuthentication
from utils.exceptions import LoginRequired
class SessionAuthenticate(SessionAuthentication):
def authenticate(self, request):
# 获取 request 用户
us... | 31.4375 | 83 | 0.670974 |
fff1c735ec35b11df233e882120a6e7c918f9fb6 | 4,525 | py | Python | codes/Bulkflowcodefinal.py | Mr-Markovian/SphericalHarmonics_for_StokesFlow | f1577426bcc3805f3b3727b0cb607daa87576b03 | [
"MIT"
] | null | null | null | codes/Bulkflowcodefinal.py | Mr-Markovian/SphericalHarmonics_for_StokesFlow | f1577426bcc3805f3b3727b0cb607daa87576b03 | [
"MIT"
] | null | null | null | codes/Bulkflowcodefinal.py | Mr-Markovian/SphericalHarmonics_for_StokesFlow | f1577426bcc3805f3b3727b0cb607daa87576b03 | [
"MIT"
] | null | null | null | #We can compute Bulk flow and find the flow field inside at a radius r,given
#the velocity field at the Surface(radius R),l is a 1-D array
#%!-L/usr/local/lib -lfftw3 -lm
#!/usr/bin/python3.7
#l=0,1 mode not possible for Vlm_y and Vlm_psi,l=0 not possible for Vlm_phi.
def modify_(a,b,c,l):
x=np.where(l==1)
... | 34.541985 | 132 | 0.606188 |
8ee6aff60f5850e8d206319616b3c8046120f824 | 991 | py | Python | examples/example_calculate_hd.py | QuantLet/spd_trading | 1f4d7a732a96fde88d91b1ae94344bc342a8eed9 | [
"MIT"
] | 2 | 2021-04-28T09:39:51.000Z | 2021-10-22T03:11:15.000Z | examples/example_calculate_hd.py | QuantLet/spd_trading | 1f4d7a732a96fde88d91b1ae94344bc342a8eed9 | [
"MIT"
] | null | null | null | examples/example_calculate_hd.py | QuantLet/spd_trading | 1f4d7a732a96fde88d91b1ae94344bc342a8eed9 | [
"MIT"
] | 2 | 2021-05-12T08:21:15.000Z | 2021-12-07T17:05:58.000Z | import os
import pandas as pd
from matplotlib import pyplot as plt
from spd_trading import historical_density as hd
import logging
logging.basicConfig(level=logging.INFO)
HD_TESTDATA_FILENAME = os.path.join(".", "examples", "data", "hd_input_data.csv")
hd_input_data = pd.read_csv(HD_TESTDATA_FILENAME)
evaluation_day... | 28.314286 | 81 | 0.753784 |
c4ccdc327ac735c2ad411f6554c587ab135c567d | 14,047 | py | Python | sphinx_book_theme/__init__.py | rscohn2/sphinx-book-theme | 8e938cb62501fbde24524ab6660f2c887560e866 | [
"BSD-3-Clause"
] | null | null | null | sphinx_book_theme/__init__.py | rscohn2/sphinx-book-theme | 8e938cb62501fbde24524ab6660f2c887560e866 | [
"BSD-3-Clause"
] | null | null | null | sphinx_book_theme/__init__.py | rscohn2/sphinx-book-theme | 8e938cb62501fbde24524ab6660f2c887560e866 | [
"BSD-3-Clause"
] | null | null | null | """A lightweight book theme based on the pydata sphinx theme."""
import os
from pathlib import Path
try:
import importlib.resources as resources
except ImportError:
# python < 3.7
import importlib_resources as resources
from bs4 import BeautifulSoup as bs
from docutils.parsers.rst import directives
from d... | 35.652284 | 88 | 0.612444 |
06a8a01319ae7e70f0d52c6ff9668c0cdad8f39d | 10,415 | py | Python | train_scripts/vgg500/rbm5vgg.py | franciscovargas/TeviotDataScienceGame | 77bdffb87b2a25490ca175b3a2f96459067e4ccb | [
"MIT"
] | null | null | null | train_scripts/vgg500/rbm5vgg.py | franciscovargas/TeviotDataScienceGame | 77bdffb87b2a25490ca175b3a2f96459067e4ccb | [
"MIT"
] | null | null | null | train_scripts/vgg500/rbm5vgg.py | franciscovargas/TeviotDataScienceGame | 77bdffb87b2a25490ca175b3a2f96459067e4ccb | [
"MIT"
] | null | null | null | # same as 410 with different augmentation
from keras.layers.convolutional import Convolution2D, MaxPooling2D, UpSampling2D, ZeroPadding2D
from keras.layers import Input, Dense, Dropout, Flatten, BatchNormalization
from keras.models import Model
from keras.preprocessing.image import ImageDataGenerator
from keras.regul... | 30.813609 | 113 | 0.605089 |
dd8a481b93d63726ebe1dd38a7d81e360ccd7a7d | 3,853 | py | Python | cobe/scoring.py | nullie/cobe | 82054f681583043d322caef0de57a65917fae444 | [
"MIT"
] | 174 | 2015-01-06T00:34:00.000Z | 2022-03-17T18:37:16.000Z | cobe/scoring.py | nullie/cobe | 82054f681583043d322caef0de57a65917fae444 | [
"MIT"
] | 22 | 2015-03-20T20:58:33.000Z | 2021-07-13T23:08:28.000Z | cobe/scoring.py | nullie/cobe | 82054f681583043d322caef0de57a65917fae444 | [
"MIT"
] | 45 | 2015-03-14T00:19:55.000Z | 2021-12-23T01:12:43.000Z | # Copyright (C) 2012 Peter Teichman
import math
class Scorer:
def __init__(self):
self.cache = {}
def end(self, reply):
self.cache = {}
def normalize(self, score):
# map high-valued scores into 0..1
if score < 0:
return score
return 1.0 - 1.0 / (1.0 ... | 28.540741 | 75 | 0.595899 |
c16765bd93f57fa393f0ccdcf4b823c4b61282fb | 3,326 | py | Python | contrib/zmq/zmq_sub3.4.py | caffeine239/bitcoin | 94e5f13e62041bc299514b38a04ba1686002143e | [
"MIT"
] | null | null | null | contrib/zmq/zmq_sub3.4.py | caffeine239/bitcoin | 94e5f13e62041bc299514b38a04ba1686002143e | [
"MIT"
] | null | null | null | contrib/zmq/zmq_sub3.4.py | caffeine239/bitcoin | 94e5f13e62041bc299514b38a04ba1686002143e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
ZMQ example using python3's asyncio
Muskcoin should be started with the command line argumen... | 36.549451 | 107 | 0.65003 |
72e83c9ff119f2446f24ea107f3ac4a4b675c5ef | 1,245 | py | Python | web-app1/predict.py | shemaaali/TwitOff | 11678dc2b87b89d650e1e8c6faee13b622f5a325 | [
"MIT"
] | null | null | null | web-app1/predict.py | shemaaali/TwitOff | 11678dc2b87b89d650e1e8c6faee13b622f5a325 | [
"MIT"
] | null | null | null | web-app1/predict.py | shemaaali/TwitOff | 11678dc2b87b89d650e1e8c6faee13b622f5a325 | [
"MIT"
] | null | null | null | """Prediction of Users based on Tweet embeddings"""
import pickle
import numpy as np
from sklearn.linear_model import LogisticRegression
from .models import User
from .twitter import BASILICA
def predict_user(user1_name, user2_name, tweet_text, cache=None):
"""Determine and return which user is more likely to sa... | 49.8 | 80 | 0.704418 |
301fb73a2800ea21ce9afa841cb8d89b90dedf7e | 1,325 | py | Python | fortran/version3/examples/HSX_PASCollisions_fullTrajectories/tests.py | amollen/sfincs | a529954fd36330e1b5c816612943f39829f3542f | [
"BSD-2-Clause"
] | 15 | 2017-10-13T15:15:11.000Z | 2022-03-31T17:56:20.000Z | fortran/version3/examples/HSX_PASCollisions_fullTrajectories/tests.py | amollen/sfincs | a529954fd36330e1b5c816612943f39829f3542f | [
"BSD-2-Clause"
] | 4 | 2018-01-02T09:04:48.000Z | 2021-01-28T09:53:21.000Z | fortran/version3/examples/HSX_PASCollisions_fullTrajectories/tests.py | amollen/sfincs | a529954fd36330e1b5c816612943f39829f3542f | [
"BSD-2-Clause"
] | 9 | 2015-03-19T14:30:10.000Z | 2022-02-03T14:37:14.000Z | #!/usr/bin/env python
# This python script checks the sfincsOutput.h5 file for an example to
# see if the results are close to expected values. This script may be
# run directly, and it is also called when "make test" is run from the
# main SFINCS directory.
#execfile('../testsCommon.py')
exec(open('../testsCommon.... | 44.166667 | 131 | 0.754717 |
ac603049f285ae39f3e7a5e50b1c372331764cf9 | 421 | py | Python | core/controllers/static.py | tzakrajs/yaiges | 046e376dc7a03466cf2860cf29509d251ed667e3 | [
"Apache-2.0"
] | null | null | null | core/controllers/static.py | tzakrajs/yaiges | 046e376dc7a03466cf2860cf29509d251ed667e3 | [
"Apache-2.0"
] | null | null | null | core/controllers/static.py | tzakrajs/yaiges | 046e376dc7a03466cf2860cf29509d251ed667e3 | [
"Apache-2.0"
] | null | null | null | import tornado.web
from core import route
# Static Assets
route._routes.append(['/assets/(.*)', tornado.web.StaticFileHandler, {'path': 'core/static/assets/'}])
route._routes.append(['/app/(.*)', tornado.web.StaticFileHandler, {'path': 'core/static/app/'}])
# Index for Angular Single Page
@route('/')
class HomePage ... | 30.071429 | 102 | 0.691211 |
09fd087f562c087fdf61ad93bc635db64c40f015 | 4,520 | py | Python | django/contrib/auth/mixins.py | peteralexandercharles/django | 61c7350f41f2534daf3888709f3c987b7d779a29 | [
"BSD-3-Clause",
"0BSD"
] | null | null | null | django/contrib/auth/mixins.py | peteralexandercharles/django | 61c7350f41f2534daf3888709f3c987b7d779a29 | [
"BSD-3-Clause",
"0BSD"
] | null | null | null | django/contrib/auth/mixins.py | peteralexandercharles/django | 61c7350f41f2534daf3888709f3c987b7d779a29 | [
"BSD-3-Clause",
"0BSD"
] | null | null | null | from urllib.parse import urlparse
from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.views import redirect_to_login
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.shortcuts import resolve_url
class AccessMixin:
"""
... | 33.984962 | 112 | 0.656858 |
39006299a40508b6c6f067e0e88dae2d8ad33ff8 | 300 | py | Python | coocur/coword/stats.py | kunlubrain/legacy | 003c7b644216a0ef704a231d7f364b1bacd97329 | [
"Apache-2.0"
] | null | null | null | coocur/coword/stats.py | kunlubrain/legacy | 003c7b644216a0ef704a231d7f364b1bacd97329 | [
"Apache-2.0"
] | null | null | null | coocur/coword/stats.py | kunlubrain/legacy | 003c7b644216a0ef704a231d7f364b1bacd97329 | [
"Apache-2.0"
] | null | null | null | import fif
__DF_WORD_WIKI__ = fif.readDFAsRatioFromFile('statDFWord_Wiki.txt', indexOfRatio=2)
__DF_WORD_IEEE__ = fif.readDFAsRatioFromFile('statDFWord_Ieee.txt', indexOfRatio=2)
def getDFOfWordAsRatio_Wiki():
return __DF_WORD_WIKI__
def getDFOfWordAsRatio_Ieee():
return __DF_WORD_IEEE__
| 27.272727 | 83 | 0.823333 |
cc0addbcf5680bbde8e46431dc25bb0a1796ea76 | 1,131 | py | Python | Flask-Mega-Tutorial/migrations/versions/9a574dabdc15_users_table.py | robertove93/Flask-mega-tutorial | 55998f978c49ded9a272f80c6ed7b0f1dc3c24b3 | [
"Apache-2.0"
] | null | null | null | Flask-Mega-Tutorial/migrations/versions/9a574dabdc15_users_table.py | robertove93/Flask-mega-tutorial | 55998f978c49ded9a272f80c6ed7b0f1dc3c24b3 | [
"Apache-2.0"
] | null | null | null | Flask-Mega-Tutorial/migrations/versions/9a574dabdc15_users_table.py | robertove93/Flask-mega-tutorial | 55998f978c49ded9a272f80c6ed7b0f1dc3c24b3 | [
"Apache-2.0"
] | null | null | null | """users table
Revision ID: 9a574dabdc15
Revises:
Create Date: 2020-04-13 15:24:58.243707
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9a574dabdc15'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto genera... | 29 | 80 | 0.678161 |
44239c7804e5ef24ebe5a7e785f6975e7a5c4f65 | 4,744 | py | Python | ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params_linux.py | emcvipr/ambari | 045e0d2ac94b8b81819d2efbfd7e1bddc67a7756 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-05-06T06:24:04.000Z | 2021-05-06T06:24:04.000Z | ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params_linux.py | emcvipr/ambari | 045e0d2ac94b8b81819d2efbfd7e1bddc67a7756 | [
"Apache-2.0",
"MIT"
] | null | null | null | ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/package/scripts/params_linux.py | emcvipr/ambari | 045e0d2ac94b8b81819d2efbfd7e1bddc67a7756 | [
"Apache-2.0",
"MIT"
] | 3 | 2017-10-31T11:42:31.000Z | 2021-04-26T07:17:53.000Z | #!/usr/bin/env python
"""
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");... | 43.127273 | 108 | 0.807757 |
52f07f92c6c571addc95396e04ee8c24d6d2b3c6 | 417 | py | Python | apps/requests/migrations/0009_request_request_duration.py | FelipeHoch/SupportSystem | 0cc94fa3cac41d63e0abab5a16c3b9051f8cc8c9 | [
"MIT"
] | 3 | 2021-08-29T20:58:35.000Z | 2021-11-02T14:59:04.000Z | apps/requests/migrations/0009_request_request_duration.py | FelipeHoch/SupportSystem | 0cc94fa3cac41d63e0abab5a16c3b9051f8cc8c9 | [
"MIT"
] | null | null | null | apps/requests/migrations/0009_request_request_duration.py | FelipeHoch/SupportSystem | 0cc94fa3cac41d63e0abab5a16c3b9051f8cc8c9 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-08-03 21:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('requests', '0008_request_accept_request_time'),
]
operations = [
migrations.AddField(
model_name='request',
name='re... | 21.947368 | 62 | 0.621103 |
e5ef4198ef68546c243992ab96346f539d356ec1 | 4,403 | py | Python | examples/ch12/snippets_ipynb/sentimentlistener.py | eltechno/python_course | f74abac7df3f9f41864afd06479389260c29ea3a | [
"MIT"
] | 4 | 2019-05-04T00:33:25.000Z | 2021-05-29T20:37:59.000Z | examples/ch12/snippets_ipynb/sentimentlistener.py | eltechno/python_course | f74abac7df3f9f41864afd06479389260c29ea3a | [
"MIT"
] | null | null | null | examples/ch12/snippets_ipynb/sentimentlistener.py | eltechno/python_course | f74abac7df3f9f41864afd06479389260c29ea3a | [
"MIT"
] | 3 | 2020-05-05T13:14:28.000Z | 2022-02-03T16:18:37.000Z | # sentimentlisener.py
"""Script that searches for tweets that match a search string
and tallies the number of positive, neutral and negative tweets."""
import keys
import preprocessor as p
import sys
from textblob import TextBlob
import tweepy
class SentimentListener(tweepy.StreamListener):
"""Handles i... | 40.394495 | 75 | 0.598228 |
ea18ec31b810d1df253b0c4e3e0e5d60ad3dec6d | 2,257 | py | Python | pH/pH_plotters.py | dragonoverlord3000/Kaeple | 83d8d63c5286127299d0597796312e96d574cee3 | [
"MIT"
] | 1 | 2021-08-11T08:33:51.000Z | 2021-08-11T08:33:51.000Z | pH/pH_plotters.py | dragonoverlord3000/Kaeple | 83d8d63c5286127299d0597796312e96d574cee3 | [
"MIT"
] | null | null | null | pH/pH_plotters.py | dragonoverlord3000/Kaeple | 83d8d63c5286127299d0597796312e96d574cee3 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from pH.pH_calculator import System
def bjerrum_plotter(reactant, start_pH=0, end_pH=14, show=True):
"""
Args:
reactant (Acid, Base or Neutral) - a single reactant
start_pH (int) - starting point for the numerical calculations
end_pH (... | 30.917808 | 131 | 0.641117 |
261716174ffed2c3d10019e92f3a6cea11414c9e | 10,024 | py | Python | intersight/model/storage_hitachi_array_utilization_all_of.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 5 | 2021-12-16T15:13:32.000Z | 2022-03-29T16:09:54.000Z | intersight/model/storage_hitachi_array_utilization_all_of.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 4 | 2022-01-25T19:05:51.000Z | 2022-03-29T20:18:37.000Z | intersight/model/storage_hitachi_array_utilization_all_of.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 2 | 2020-07-07T15:01:08.000Z | 2022-01-31T04:27:35.000Z | """
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan... | 53.037037 | 1,678 | 0.646049 |
e299794ebb6ab22d45e69f7ca6dbfbffe59bb8e9 | 5,087 | py | Python | tests/test_toolchain.py | mkc2019/python-for-android | f087ebf39ee399ff9831e08055d68575f54fe987 | [
"MIT"
] | 19 | 2019-11-22T06:07:37.000Z | 2022-03-16T20:45:06.000Z | tests/test_toolchain.py | mkc2019/python-for-android | f087ebf39ee399ff9831e08055d68575f54fe987 | [
"MIT"
] | 2 | 2017-10-28T07:15:32.000Z | 2020-11-22T02:39:42.000Z | tests/test_toolchain.py | mkc2019/python-for-android | f087ebf39ee399ff9831e08055d68575f54fe987 | [
"MIT"
] | 8 | 2017-07-20T05:34:04.000Z | 2021-08-03T08:21:32.000Z | import io
import sys
import pytest
from unittest import mock
from pythonforandroid.recipe import Recipe
from pythonforandroid.toolchain import ToolchainCL
from pythonforandroid.util import BuildInterruptingException
def patch_sys_argv(argv):
return mock.patch('sys.argv', argv)
def patch_argparse_print_help():
... | 35.326389 | 85 | 0.60114 |
f7236a746c46b2c1dbd28b9ceab6f34dcfd7b14b | 21,947 | py | Python | nemo/core/optim/lr_scheduler.py | mcdavid109/NeMo | a7df3e0271ab6133f7fe057ec697f764c8637d54 | [
"Apache-2.0"
] | null | null | null | nemo/core/optim/lr_scheduler.py | mcdavid109/NeMo | a7df3e0271ab6133f7fe057ec697f764c8637d54 | [
"Apache-2.0"
] | null | null | null | nemo/core/optim/lr_scheduler.py | mcdavid109/NeMo | a7df3e0271ab6133f7fe057ec697f764c8637d54 | [
"Apache-2.0"
] | 1 | 2020-12-18T14:23:37.000Z | 2020-12-18T14:23:37.000Z | # Copyright (c) 2020, NVIDIA CORPORATION. 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 appli... | 37.839655 | 119 | 0.659179 |
b24f8302809ecad063dbdd5f4895306cfe266204 | 2,336 | py | Python | aliyun-python-sdk-mpaas/aliyunsdkmpaas/request/v20190821/UpdateMcubeWhitelistRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-mpaas/aliyunsdkmpaas/request/v20190821/UpdateMcubeWhitelistRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-mpaas/aliyunsdkmpaas/request/v20190821/UpdateMcubeWhitelistRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.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... | 31.567568 | 75 | 0.747432 |
c8290defa411129c0892f28c9818ffaaea0b5510 | 12,788 | py | Python | tests_basic/test_field_analysis.py | mitcgs/pylinac | e36a531b2db72f7d2bd0a754125c6c92ae60e8e8 | [
"MIT"
] | null | null | null | tests_basic/test_field_analysis.py | mitcgs/pylinac | e36a531b2db72f7d2bd0a754125c6c92ae60e8e8 | [
"MIT"
] | null | null | null | tests_basic/test_field_analysis.py | mitcgs/pylinac | e36a531b2db72f7d2bd0a754125c6c92ae60e8e8 | [
"MIT"
] | null | null | null | """Tests for the flatsym module of pylinac."""
import enum
import io
import os.path as osp
from unittest import TestCase
from pylinac.core.exceptions import NotAnalyzed
from pylinac.core.io import retrieve_demo_file
from pylinac.core.profile import Edge, Normalization, Interpolation
from pylinac.field_analysis import ... | 34.939891 | 169 | 0.693306 |
e7e939f1e1033628d5c67aaf526ba774e170f9c0 | 273 | py | Python | utils/mixin.py | A-Wei/fresh_shopping | 24cba5e7b335ef7f95acf7bc4c4a84530b62321c | [
"MIT"
] | null | null | null | utils/mixin.py | A-Wei/fresh_shopping | 24cba5e7b335ef7f95acf7bc4c4a84530b62321c | [
"MIT"
] | 7 | 2020-06-05T22:28:11.000Z | 2021-09-08T01:18:03.000Z | utils/mixin.py | A-Wei/fresh_shopping | 24cba5e7b335ef7f95acf7bc4c4a84530b62321c | [
"MIT"
] | null | null | null | from django.contrib.auth.decorators import login_required
class LoginRequiredMixin(object):
@classmethod
def as_view(cls, **initkwargs):
# 调用父类的as_view
view = super(LoginRequiredMixin, cls).as_view(**initkwargs)
return login_required(view) | 30.333333 | 67 | 0.721612 |
333405ec709de0d1b35cea87957fd21282b619d4 | 2,911 | py | Python | test/mitmproxy/addons/test_proxyserver.py | jrblixt/mitmproxy | bc3f39a202a6db04a1705303c1c7de368171221b | [
"MIT"
] | 2 | 2021-07-07T11:47:43.000Z | 2021-08-03T09:50:35.000Z | test/mitmproxy/addons/test_proxyserver.py | PeterDaveHello/mitmproxy | 4bd7b6c4eadeaca712f63e0e73f20bcf6aadbffb | [
"MIT"
] | null | null | null | test/mitmproxy/addons/test_proxyserver.py | PeterDaveHello/mitmproxy | 4bd7b6c4eadeaca712f63e0e73f20bcf6aadbffb | [
"MIT"
] | null | null | null | import asyncio
from contextlib import asynccontextmanager
import pytest
from mitmproxy.addons.proxyserver import Proxyserver
from mitmproxy.proxy.layers.http import HTTPMode
from mitmproxy.proxy import layers
from mitmproxy.connection import Address
from mitmproxy.test import taddons
class HelperAddon:
def __in... | 34.654762 | 105 | 0.650292 |
5575f8e4c5ed6b1ffa570c8ff69ac2ede47af9d9 | 47 | py | Python | osu_irc_sdk/__init__.py | chinosk114514/osu-bot-sdk | 313d8a0839e1d432a27b297f6813c172b26a4b5e | [
"MIT"
] | 2 | 2021-12-14T16:22:58.000Z | 2021-12-14T16:40:35.000Z | osu_irc_sdk/__init__.py | chinosk114514/osu-bot-sdk | 313d8a0839e1d432a27b297f6813c172b26a4b5e | [
"MIT"
] | null | null | null | osu_irc_sdk/__init__.py | chinosk114514/osu-bot-sdk | 313d8a0839e1d432a27b297f6813c172b26a4b5e | [
"MIT"
] | null | null | null | from .bot import *
from .ws import OsuIrcProxy
| 15.666667 | 27 | 0.765957 |
d99248af5c6b1e4131d9990e2fed06bca9e59b13 | 20,774 | py | Python | vtr_flow/scripts/python_libs/vtr/task.py | RustamC/vtr-verilog-to-routing | 8e00e82a03ce12b7987a244620a0e3624083ae79 | [
"MIT"
] | 1 | 2021-06-30T03:31:08.000Z | 2021-06-30T03:31:08.000Z | vtr_flow/scripts/python_libs/vtr/task.py | PaulaPerdomo/vtr-verilog-to-routing | d5c9dce0172ec5d122e7c13c259b6c7c92793860 | [
"MIT"
] | null | null | null | vtr_flow/scripts/python_libs/vtr/task.py | PaulaPerdomo/vtr-verilog-to-routing | d5c9dce0172ec5d122e7c13c259b6c7c92793860 | [
"MIT"
] | 1 | 2022-03-03T16:47:46.000Z | 2022-03-03T16:47:46.000Z | """
Module that contains the task functions
"""
from pathlib import Path
from pathlib import PurePath
from shlex import split
import itertools
from vtr import (
VtrError,
InspectError,
load_list_file,
load_parse_results,
get_next_run_dir,
find_task_dir,
load_script_param,
get_latest_run... | 32.358255 | 107 | 0.588332 |
e95c1054ddb43164502dfe98d831b4f5ec57bd5d | 5,356 | py | Python | temboo/core/Library/Microsoft/Translator/GetLanguageNames.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 7 | 2016-03-07T02:07:21.000Z | 2022-01-21T02:22:41.000Z | temboo/core/Library/Microsoft/Translator/GetLanguageNames.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | null | null | null | temboo/core/Library/Microsoft/Translator/GetLanguageNames.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 8 | 2016-06-14T06:01:11.000Z | 2020-04-22T09:21:44.000Z | # -*- coding: utf-8 -*-
###############################################################################
#
# GetLanguageNames
# Retrieves friendly names for languages and localized using the specified locale language.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache Licens... | 45.389831 | 228 | 0.698469 |
1c78f6beea6ed2aad1a5621d81ae1c7f085839e9 | 7,366 | py | Python | tests/test_html_shifts.py | frutoper/Hockey-Scraper | bd521a4670396f0a565573fdc9cb95c28064ce0a | [
"MIT"
] | null | null | null | tests/test_html_shifts.py | frutoper/Hockey-Scraper | bd521a4670396f0a565573fdc9cb95c28064ce0a | [
"MIT"
] | null | null | null | tests/test_html_shifts.py | frutoper/Hockey-Scraper | bd521a4670396f0a565573fdc9cb95c28064ce0a | [
"MIT"
] | 1 | 2019-07-18T07:31:54.000Z | 2019-07-18T07:31:54.000Z | """ Tests for 'html_shifts.py' """
import pandas as pd
import pytest
import bs4
from hockey_scraper import html_shifts
@pytest.fixture
def shift_cols():
return ['Game_Id', 'Period', 'Team', 'Player', 'Player_Id', 'Start', 'End', 'Duration']
@pytest.fixture
def game_id():
return '2009020001'
@pytest.fixtur... | 47.217949 | 112 | 0.567879 |
ab31ba42c65a0dcbc8c1dc79047494c54b5b8fdd | 2,163 | py | Python | hoppfish/hwangsae-recorder-user-command.py | xhaakon/hoppfish | 7ac2345b5843287b66ba0380bb8879fa892193e1 | [
"Apache-2.0"
] | null | null | null | hoppfish/hwangsae-recorder-user-command.py | xhaakon/hoppfish | 7ac2345b5843287b66ba0380bb8879fa892193e1 | [
"Apache-2.0"
] | null | null | null | hoppfish/hwangsae-recorder-user-command.py | xhaakon/hoppfish | 7ac2345b5843287b66ba0380bb8879fa892193e1 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2019 SK Telecom Co., Ltd.
# Author: Walter Lozano <walter.lozano@collabora.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/LI... | 30.9 | 88 | 0.59963 |
64ef0336b21d10b371e1411a455345dc789d0799 | 44,142 | py | Python | src/matcouply/decomposition.py | MarieRoald/matcouply | c07350705fc9b34eb884c9dc971e0103cdef9df5 | [
"MIT"
] | null | null | null | src/matcouply/decomposition.py | MarieRoald/matcouply | c07350705fc9b34eb884c9dc971e0103cdef9df5 | [
"MIT"
] | null | null | null | src/matcouply/decomposition.py | MarieRoald/matcouply | c07350705fc9b34eb884c9dc971e0103cdef9df5 | [
"MIT"
] | null | null | null | from copy import copy
from typing import NamedTuple, Optional
import numpy as np
import tensorly as tl
import tensorly.decomposition
from . import penalties
from ._utils import create_padded_tensor, get_shapes, get_svd, is_iterable
from .coupled_matrices import CoupledMatrixFactorization, cmf_to_matrices
__all__ = [... | 39.803427 | 140 | 0.649789 |
2d7f8ae3d424fcd57e3af12046a915fa3ecec292 | 6,407 | py | Python | salt/spm/pkgfiles/local.py | jubrad/salt | 7960334fb726cfde45e6409da79a65535c626685 | [
"Apache-2.0"
] | 1 | 2020-01-02T09:03:21.000Z | 2020-01-02T09:03:21.000Z | salt/spm/pkgfiles/local.py | jubrad/salt | 7960334fb726cfde45e6409da79a65535c626685 | [
"Apache-2.0"
] | 3 | 2015-03-31T14:44:05.000Z | 2015-06-18T19:02:24.000Z | salt/spm/pkgfiles/local.py | jubrad/salt | 7960334fb726cfde45e6409da79a65535c626685 | [
"Apache-2.0"
] | 1 | 2020-01-02T09:03:24.000Z | 2020-01-02T09:03:24.000Z | # -*- coding: utf-8 -*-
'''
This module allows SPM to use the local filesystem to install files for SPM.
.. versionadded:: 2015.8.0
'''
# Import Python libs
from __future__ import absolute_import
import os
import os.path
import logging
# Import Salt libs
import salt.syspaths
import salt.utils.files
import salt.utils... | 31.406863 | 88 | 0.598252 |
5280dbb7a3915c75be9d1e6d978ce39d7e8482b9 | 2,484 | py | Python | tests/python/gaia-ui-tests/gaiatest/apps/phone/app.py | dcoloma/gaia | e542540cfa64c31ac8bb71b1a9cf16879fc9d58e | [
"Apache-2.0"
] | 1 | 2019-06-14T02:03:32.000Z | 2019-06-14T02:03:32.000Z | tests/python/gaia-ui-tests/gaiatest/apps/phone/app.py | AmyYLee/gaia | a5dbae8235163d7f985bdeb7d649268f02749a8b | [
"Apache-2.0"
] | 1 | 2021-11-01T18:29:16.000Z | 2021-11-01T18:29:16.000Z | tests/python/gaia-ui-tests/gaiatest/apps/phone/app.py | AmyYLee/gaia | a5dbae8235163d7f985bdeb7d649268f02749a8b | [
"Apache-2.0"
] | 1 | 2021-08-20T11:26:36.000Z | 2021-08-20T11:26:36.000Z | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from marionette.by import By
from gaiatest.apps.base import Base
class Phone(Base):
name = "Phone"
_dialog_l... | 36.529412 | 84 | 0.728663 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.