max_stars_repo_path stringlengths 4 286 | max_stars_repo_name stringlengths 5 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.03M | content_cleaned stringlengths 6 1.03M | language stringclasses 111
values | language_score float64 0.03 1 | comments stringlengths 0 556k | edu_score float64 0.32 5.03 | edu_int_score int64 0 5 |
|---|---|---|---|---|---|---|---|---|---|---|
Unsupervised/pix2pixHD/extract_frames.py | Kebniss/AutoDetect | 1 | 1600 | <filename>Unsupervised/pix2pixHD/extract_frames.py
import os
import cv2
import argparse
from utils import *
from tqdm import tqdm
from glob import glob
from pathlib import Path
def _extract_frames(video_path, parent, start=0, sampling_f=1):
vidcap = cv2.VideoCapture(video_path)
success, image = success, image... | <filename>Unsupervised/pix2pixHD/extract_frames.py
import os
import cv2
import argparse
from utils import *
from tqdm import tqdm
from glob import glob
from pathlib import Path
def _extract_frames(video_path, parent, start=0, sampling_f=1):
vidcap = cv2.VideoCapture(video_path)
success, image = success, image... | en | 0.847354 | # sampling # read next Path to a single video or a folder. If path to folder the algorithm will extract frames from all files with extension defined in --extension and save them under separate folders under dest_folder. The frames from each video will be saved under a folder with its name. Pa... | 3.172501 | 3 |
burp-filter-options/filter-options.py | parsiya/Parsia-Code | 21 | 1601 | <reponame>parsiya/Parsia-Code
# modified "example traffic redirector"
# https://raw.githubusercontent.com/PortSwigger/example-traffic-redirector/master/python/TrafficRedirector.py
# Idea: https://github.com/pajswigger/filter-options/blob/master/src/filter-options.kt
# Usage: Put both files in a directory and add fi... | # modified "example traffic redirector"
# https://raw.githubusercontent.com/PortSwigger/example-traffic-redirector/master/python/TrafficRedirector.py
# Idea: https://github.com/pajswigger/filter-options/blob/master/src/filter-options.kt
# Usage: Put both files in a directory and add filter-options.py to Burp. Nees ... | en | 0.673687 | # modified "example traffic redirector" # https://raw.githubusercontent.com/PortSwigger/example-traffic-redirector/master/python/TrafficRedirector.py # Idea: https://github.com/pajswigger/filter-options/blob/master/src/filter-options.kt # Usage: Put both files in a directory and add filter-options.py to Burp. Nees Jyth... | 2.273983 | 2 |
AppServer/google/appengine/tools/devappserver2/login.py | loftwah/appscale | 790 | 1602 | <reponame>loftwah/appscale
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | en | 0.636999 | #!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o... | 2.225551 | 2 |
sdks/python/apache_beam/runners/portability/job_server.py | noah-goodrich/beam | 1 | 1603 | #
# 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 us... | #
# 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 us... | en | 0.903465 | # # 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 us... | 1.688606 | 2 |
sympy/printing/pycode.py | tachycline/sympy | 0 | 1604 | from collections import defaultdict
from functools import wraps
from itertools import chain
from sympy.core import sympify
from .precedence import precedence
from .codeprinter import CodePrinter
_kw_py2and3 = {
'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif',
'else', 'except', 'finall... | from collections import defaultdict
from functools import wraps
from itertools import chain
from sympy.core import sympify
from .precedence import precedence
from .codeprinter import CodePrinter
_kw_py2and3 = {
'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif',
'else', 'except', 'finall... | en | 0.793312 | # 'None' is actually not in Python 2's keyword.kwlist # Not used from ``math``: [copysign isclose isfinite isinf isnan ldexp frexp pow modf # radians trunc fmod fsum gcd degrees fabs] # Only in python >= 3.5: # 'Infinity': 'inf', # 'NaN': 'nan' # initialized to a set in __init__ # {0}".format(text) Lambda printer for m... | 2.269948 | 2 |
arguments_setting.py | Projectoy/ml_framework | 0 | 1605 | <gh_stars>0
import argparse, os
class ArgumentManager:
def __init__(self, model_list):
self.model_list = model_list
self.args = self.get_input_arguments()
self.validate_arguments()
def get_input_arguments(self):
parser = argparse.ArgumentParser(description='Process some integer... | import argparse, os
class ArgumentManager:
def __init__(self, model_list):
self.model_list = model_list
self.args = self.get_input_arguments()
self.validate_arguments()
def get_input_arguments(self):
parser = argparse.ArgumentParser(description='Process some integers.')
... | none | 1 | 3.122219 | 3 | |
fileHandler.py | Omer-Sella/ldpc | 0 | 1606 | # -*- coding: utf-8 -*-
"""
Created on Thu Nov 28 12:10:11 2019
@author: Omer
"""
## File handler
## This file was initially intended purely to generate the matrices for the near earth code found in: https://public.ccsds.org/Pubs/131x1o2e2s.pdf
## The values from the above pdf were copied manually to a txt file, and ... | # -*- coding: utf-8 -*-
"""
Created on Thu Nov 28 12:10:11 2019
@author: Omer
"""
## File handler
## This file was initially intended purely to generate the matrices for the near earth code found in: https://public.ccsds.org/Pubs/131x1o2e2s.pdf
## The values from the above pdf were copied manually to a txt file, and ... | en | 0.734454 | # -*- coding: utf-8 -*- Created on Thu Nov 28 12:10:11 2019 @author: Omer ## File handler ## This file was initially intended purely to generate the matrices for the near earth code found in: https://public.ccsds.org/Pubs/131x1o2e2s.pdf ## The values from the above pdf were copied manually to a txt file, and it is the... | 2.387931 | 2 |
stage/configuration/test_amazon_s3_origin.py | Sentienz/datacollector-tests | 0 | 1607 | <gh_stars>0
import logging
import pytest
from streamsets.testframework.markers import aws, sdc_min_version
from streamsets.testframework.utils import get_random_string
logger = logging.getLogger(__name__)
S3_SANDBOX_PREFIX = 'sandbox'
LOG_FIELD_MAPPING = [{'fieldPath': '/date', 'group': 1},
{'fi... | import logging
import pytest
from streamsets.testframework.markers import aws, sdc_min_version
from streamsets.testframework.utils import get_random_string
logger = logging.getLogger(__name__)
S3_SANDBOX_PREFIX = 'sandbox'
LOG_FIELD_MAPPING = [{'fieldPath': '/date', 'group': 1},
{'fieldPath': '/... | en | 0.808476 | # log to be written int the file on s3 # data to verify the output of amazon s3 origin. Check whether S3 origin can parse different log format or not. A log file is being created in s3 bucket mentioned below .S3 origin reads the log file and parse the same. Pipeline for the same- s3_origin >> trash s3_... | 1.921228 | 2 |
model_building/svr_experiment_configuration.py | eubr-atmosphere/a-MLLibrary | 3 | 1608 | <gh_stars>1-10
"""
Copyright 2019 <NAME>
Copyright 2019 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or ... | """
Copyright 2019 <NAME>
Copyright 2019 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wr... | en | 0.747303 | Copyright 2019 <NAME> Copyright 2019 <NAME> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writin... | 2.393748 | 2 |
src/scs_host/sys/host_gpi.py | south-coast-science/scs_host_rpi | 0 | 1609 | <reponame>south-coast-science/scs_host_rpi<filename>src/scs_host/sys/host_gpi.py<gh_stars>0
"""
Created on 12 May 2017
@author: <NAME> (<EMAIL>)
"""
from scs_host.sys.host_gpio import HostGPIO
# --------------------------------------------------------------------------------------------------------------------
# n... | """
Created on 12 May 2017
@author: <NAME> (<EMAIL>)
"""
from scs_host.sys.host_gpio import HostGPIO
# --------------------------------------------------------------------------------------------------------------------
# noinspection PyUnusedLocal,PyAbstractClass
class HostGPI(HostGPIO):
"""
classdocs
... | en | 0.161058 | Created on 12 May 2017 @author: <NAME> (<EMAIL>) # -------------------------------------------------------------------------------------------------------------------- # noinspection PyUnusedLocal,PyAbstractClass classdocs # ----------------------------------------------------------------------------------------------... | 1.948076 | 2 |
30-39/35. final_class/final_class.py | dcragusa/PythonMorsels | 1 | 1610 | <filename>30-39/35. final_class/final_class.py
class Unsubclassable:
def __init_subclass__(cls, **kwargs):
raise TypeError('Unacceptable base type')
def prevent_subclassing():
raise TypeError('Unacceptable base type')
def final_class(cls):
setattr(cls, '__init_subclass__', prevent_subclassing)
... | <filename>30-39/35. final_class/final_class.py
class Unsubclassable:
def __init_subclass__(cls, **kwargs):
raise TypeError('Unacceptable base type')
def prevent_subclassing():
raise TypeError('Unacceptable base type')
def final_class(cls):
setattr(cls, '__init_subclass__', prevent_subclassing)
... | none | 1 | 2.808279 | 3 | |
benchmark/AMS/HIGGSTES/TP.py | victor-estrade/SystGradDescent | 2 | 1611 | <gh_stars>1-10
#!/usr/bin/env python
# coding: utf-8
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from __future__ import unicode_literals
# Command line :
# python -m benchmark.VAR.GG.TP
import os
import logging
from config import SEED
from config import... | #!/usr/bin/env python
# coding: utf-8
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from __future__ import unicode_literals
# Command line :
# python -m benchmark.VAR.GG.TP
import os
import logging
from config import SEED
from config import _ERROR
from co... | en | 0.447489 | #!/usr/bin/env python # coding: utf-8 # Command line : # python -m benchmark.VAR.GG.TP # ===================================================================== # MAIN # ===================================================================== # BASIC SETUP # INFO # RUN # EVALUATION # LOAD/GENERATE DATA # SET MODEL # TRAININ... | 1.93705 | 2 |
papermill/tests/test_adl.py | dmartinpro/papermill | 0 | 1612 | import unittest
from ..adl import ADL
import six
if six.PY3:
from unittest.mock import Mock, MagicMock
else:
from mock import Mock, MagicMock
class ADLTest(unittest.TestCase):
"""
Tests for `ADL`
"""
def setUp(self):
self.ls = Mock(return_value=["foo", "bar", "baz"])
self.fak... | import unittest
from ..adl import ADL
import six
if six.PY3:
from unittest.mock import Mock, MagicMock
else:
from mock import Mock, MagicMock
class ADLTest(unittest.TestCase):
"""
Tests for `ADL`
"""
def setUp(self):
self.ls = Mock(return_value=["foo", "bar", "baz"])
self.fak... | en | 0.881424 | Tests for `ADL` | 2.932233 | 3 |
users/views.py | AnvarKhan/django-python | 1 | 1613 | <reponame>AnvarKhan/django-python
from django.views.generic import CreateView
from django.urls import reverse_lazy
from .forms import CustomUserCreationForm
class SignUpView(CreateView):
form_class = CustomUserCreationForm
success_url = reverse_lazy('login')
template_name = 'signup.html'
| from django.views.generic import CreateView
from django.urls import reverse_lazy
from .forms import CustomUserCreationForm
class SignUpView(CreateView):
form_class = CustomUserCreationForm
success_url = reverse_lazy('login')
template_name = 'signup.html' | none | 1 | 1.821117 | 2 | |
st3/package_util/compat/typing.py | Thom1729/package_util | 18 | 1614 | <filename>st3/package_util/compat/typing.py
try:
from typing import * # noqa: F401, F403
except ImportError:
from .typing_stubs import * # type: ignore # noqa: F401, F403
| <filename>st3/package_util/compat/typing.py
try:
from typing import * # noqa: F401, F403
except ImportError:
from .typing_stubs import * # type: ignore # noqa: F401, F403
| en | 0.142806 | # noqa: F401, F403 # type: ignore # noqa: F401, F403 | 1.303834 | 1 |
stanza/models/common/dropout.py | rasimuvaikas/stanza | 3,633 | 1615 | <reponame>rasimuvaikas/stanza
import torch
import torch.nn as nn
class WordDropout(nn.Module):
""" A word dropout layer that's designed for embedded inputs (e.g., any inputs to an LSTM layer).
Given a batch of embedded inputs, this layer randomly set some of them to be a replacement state.
Note that this l... | import torch
import torch.nn as nn
class WordDropout(nn.Module):
""" A word dropout layer that's designed for embedded inputs (e.g., any inputs to an LSTM layer).
Given a batch of embedded inputs, this layer randomly set some of them to be a replacement state.
Note that this layer assumes the last dimensio... | en | 0.825426 | A word dropout layer that's designed for embedded inputs (e.g., any inputs to an LSTM layer). Given a batch of embedded inputs, this layer randomly set some of them to be a replacement state. Note that this layer assumes the last dimension of the input to be the hidden dimension of a unit. A variant of dropout ... | 3.034998 | 3 |
Day01-15/code/Day15/pdf2.py | bdfd/Python_Zero2Hero_DS | 3 | 1616 | <gh_stars>1-10
"""
读取PDF文件
Version: 0.1
Author: BDFD
Date: 2018-03-26
"""
from PyPDF2 import PdfFileReader
with open('./res/Python课程大纲.pdf', 'rb') as f:
reader = PdfFileReader(f, strict=False)
print(reader.numPages)
if reader.isEncrypted:
reader.decrypt('')
current_page = reader.getPage(5)
... | """
读取PDF文件
Version: 0.1
Author: BDFD
Date: 2018-03-26
"""
from PyPDF2 import PdfFileReader
with open('./res/Python课程大纲.pdf', 'rb') as f:
reader = PdfFileReader(f, strict=False)
print(reader.numPages)
if reader.isEncrypted:
reader.decrypt('')
current_page = reader.getPage(5)
print(current... | de | 0.30314 | 读取PDF文件 Version: 0.1 Author: BDFD Date: 2018-03-26 | 3.221558 | 3 |
qt__pyqt__pyside__pyqode/qt__class_tree__parse_and_print__recursively__from__doc_qt_io/gui.py | DazEB2/SimplePyScripts | 0 | 1617 | <reponame>DazEB2/SimplePyScripts<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
from PyQt5 import QtWidgets as qtw
from PyQt5.QtTest import QTest
import time
import requests
from bs4 import BeautifulSoup
from console import get_inherited_children, ROOT_URL
class MainWindow(qtw.... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
from PyQt5 import QtWidgets as qtw
from PyQt5.QtTest import QTest
import time
import requests
from bs4 import BeautifulSoup
from console import get_inherited_children, ROOT_URL
class MainWindow(qtw.QMainWindow):
def __init__(self):
... | en | 0.308914 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- | 2.34672 | 2 |
common/OpTestASM.py | kyle-ibm/op-test | 0 | 1618 | #!/usr/bin/env python3
# encoding=utf8
# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: op-test-framework/common/OpTestASM.py $
#
# OpenPOWER Automated Test Project
#
# Contributors Listed Below - COPYRIGHT 2017
# [+] International Business Machines Corp.
#
#
# Licensed under the Apache ... | #!/usr/bin/env python3
# encoding=utf8
# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
# $Source: op-test-framework/common/OpTestASM.py $
#
# OpenPOWER Automated Test Project
#
# Contributors Listed Below - COPYRIGHT 2017
# [+] International Business Machines Corp.
#
#
# Licensed under the Apache ... | en | 0.823181 | #!/usr/bin/env python3 # encoding=utf8 # IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # $Source: op-test-framework/common/OpTestASM.py $ # # OpenPOWER Automated Test Project # # Contributors Listed Below - COPYRIGHT 2017 # [+] International Business Machines Corp. # # # Licensed under the Apache ... | 1.634602 | 2 |
test/test_storage.py | jrabasco/PyPasser | 0 | 1619 | #!/usr/bin/python3.4
__author__ = "<NAME>"
import sys
import os
sys.path.append("..")
import unittest
from modules import storage
from modules.service import Service
from modules.database import Database
class TestStorage(unittest.TestCase):
def setUp(self):
self.service = Service()
self.databas... | #!/usr/bin/python3.4
__author__ = "<NAME>"
import sys
import os
sys.path.append("..")
import unittest
from modules import storage
from modules.service import Service
from modules.database import Database
class TestStorage(unittest.TestCase):
def setUp(self):
self.service = Service()
self.databas... | fr | 0.265124 | #!/usr/bin/python3.4 | 3.075948 | 3 |
virt/ansible-latest/lib/python2.7/site-packages/ansible/plugins/lookup/template.py | lakhlaifi/RedHat-Ansible | 1 | 1620 | <filename>virt/ansible-latest/lib/python2.7/site-packages/ansible/plugins/lookup/template.py
# Copyright: (c) 2012, <NAME> <<EMAIL>>
# Copyright: (c) 2012-17, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, ... | <filename>virt/ansible-latest/lib/python2.7/site-packages/ansible/plugins/lookup/template.py
# Copyright: (c) 2012, <NAME> <<EMAIL>>
# Copyright: (c) 2012-17, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, ... | en | 0.62685 | # Copyright: (c) 2012, <NAME> <<EMAIL>> # Copyright: (c) 2012-17, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) lookup: template author: <NAME> <<EMAIL>> version_added: "0.9" short_description: retrieve contents of file after templating with Jin... | 2.548226 | 3 |
setup.py | ripiuk/fant_sizer | 0 | 1621 | from setuptools import setup, find_packages
from os.path import join, dirname
setup(
name="fant_sizer",
version="0.7",
author="<NAME>",
author_email="<EMAIL>",
description="fant_sizer command-line file-information",
url="https://github.com/ripiuk/fant_sizer",
key... | from setuptools import setup, find_packages
from os.path import join, dirname
setup(
name="fant_sizer",
version="0.7",
author="<NAME>",
author_email="<EMAIL>",
description="fant_sizer command-line file-information",
url="https://github.com/ripiuk/fant_sizer",
key... | none | 1 | 1.444363 | 1 | |
2018/Round 1A/A.py | elvisyjlin/google-code-jam | 0 | 1622 | def solve():
# Read input
R, C, H, V = map(int, input().split())
choco = []
for _ in range(R):
choco.append([0] * C)
choco_row, choco_col = [0]*R, [0]*C
num_choco = 0
for i in range(R):
row = input()
for j in range(C):
if row[j] == '@':
cho... | def solve():
# Read input
R, C, H, V = map(int, input().split())
choco = []
for _ in range(R):
choco.append([0] * C)
choco_row, choco_col = [0]*R, [0]*C
num_choco = 0
for i in range(R):
row = input()
for j in range(C):
if row[j] == '@':
cho... | en | 0.406185 | # Read input # Find H and V cuts # Check each piece #{}: {}'.format(t+1, solve())) | 3.086228 | 3 |
desktop/libs/liboozie/src/liboozie/submittion_tests.py | vinaymundada27/Hue | 1 | 1623 | <reponame>vinaymundada27/Hue
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version ... | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | en | 0.532545 | #!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma... | 1.645203 | 2 |
Training/train_baseHD.py | Wenyuan-Vincent-Li/SSL_Seg_GAN | 1 | 1624 | <gh_stars>1-10
import torch.nn as nn
import torch.optim as optim
import torch.utils.data
from Training import functions
from Training.imresize import imresize
import matplotlib.pyplot as plt
from Models.pix2pixHD_base import GANLoss, VGGLoss
from Models.pix2pixHD2 import mask2onehot
class Losses():
def __init__(se... | import torch.nn as nn
import torch.optim as optim
import torch.utils.data
from Training import functions
from Training.imresize import imresize
import matplotlib.pyplot as plt
from Models.pix2pixHD_base import GANLoss, VGGLoss
from Models.pix2pixHD2 import mask2onehot
class Losses():
def __init__(self, opt):
... | en | 0.697095 | :param netD: currD :param netG: currG :param netS: currS :param reals: a list of image pyramid ## TODO: you can just pass image shape here :param Gs: list of prev netG :param Ss: list of prev netS :param in_s: 0-> all zero [1, 3, 26, 26] :param NoiseAmp: [] -> [1] :param opt: config ... | 2.624973 | 3 |
tests/python/unittest/test_tir_pass_inject_double_buffer.py | 0xreza/tvm | 0 | 1625 | <filename>tests/python/unittest/test_tir_pass_inject_double_buffer.py
# 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 ... | <filename>tests/python/unittest/test_tir_pass_inject_double_buffer.py
# 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 ... | en | 0.865663 | # 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... | 2.125032 | 2 |
read_sensor.py | shivupoojar/openfaas-pi | 1 | 1626 | import requests
from sense_hat import SenseHat
import smbus
import time
while True:
try:
pressure=0
sense = SenseHat()
pressure = sense.get_pressure()
data = {'pressure':pressure}
print(pressure)
#send http request to sense serverless function with pressure
#data
r=req... | import requests
from sense_hat import SenseHat
import smbus
import time
while True:
try:
pressure=0
sense = SenseHat()
pressure = sense.get_pressure()
data = {'pressure':pressure}
print(pressure)
#send http request to sense serverless function with pressure
#data
r=req... | en | 0.584077 | #send http request to sense serverless function with pressure #data | 2.729702 | 3 |
trabantsim/prototypes/space_invaders.py | highfestiva/life | 9 | 1627 | #!/usr/bin/env python3
# Space Invadersishkebab.
from trabant import *
# ASCII geometries.
shipascii = r'''
/\
/XXXXXXXX\
v v
'''
invader = r'''
/XXXXXX\
/XXXXXXXX\
XXXXXXXXXX
XX XX XX
\XXXXXXXX/
/XX XX\
/X/ \/ \X\
X/ \X
'''
cam(distance=250)
gravity((0,0,0))
ship = create_ascii_object(... | #!/usr/bin/env python3
# Space Invadersishkebab.
from trabant import *
# ASCII geometries.
shipascii = r'''
/\
/XXXXXXXX\
v v
'''
invader = r'''
/XXXXXX\
/XXXXXXXX\
XXXXXXXXXX
XX XX XX
\XXXXXXXX/
/XX XX\
/X/ \/ \X\
X/ \X
'''
cam(distance=250)
gravity((0,0,0))
ship = create_ascii_object(... | en | 0.501001 | #!/usr/bin/env python3 # Space Invadersishkebab. # ASCII geometries. /\ /XXXXXXXX\ v v /XXXXXX\ /XXXXXXXX\ XXXXXXXXXX XX XX XX \XXXXXXXX/ /XX XX\ /X/ \/ \X\ X/ \X # Steering. # Only move in X. # Shooting. # Run invaders. # Check collisions, make explosions. | 2.582196 | 3 |
model/backbone/xception.py | Shang-XH/BAFTT | 4 | 1628 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.model_zoo as model_zoo
from model.sync_batchnorm.batchnorm import SynchronizedBatchNorm2d
def fixed_padding(inputs, kernel_size, dilation):
kernel_size_effective = kernel_size + (kernel_size - 1) * (dilation - 1)
... | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.model_zoo as model_zoo
from model.sync_batchnorm.batchnorm import SynchronizedBatchNorm2d
def fixed_padding(inputs, kernel_size, dilation):
kernel_size_effective = kernel_size + (kernel_size - 1) * (dilation - 1)
... | en | 0.707655 | Modified Alighed Xception # Entry flow # Middle flow # Exit flow # Init weights # Load pretrained model # Entry flow # add relu here # Middle flow # Exit flow | 2.399566 | 2 |
Backend/autonomus/utils/mail.py | IrinaMBejan/Autonom | 2 | 1629 | <gh_stars>1-10
from sendgrid import SendGridAPIClient
from sendgrid.helpers.mail import Mail, Substitution
API_KEY = '<KEY>'
API_KEY_ID = '<KEY>'
ENCODING = "utf-8"
DEFAULT_MAIL="<EMAIL>"
def link(urlsafe):
return "https://develop-dot-autonomus.appspot.com/events/details?event_id=" + urlsafe
def send_newslett... | from sendgrid import SendGridAPIClient
from sendgrid.helpers.mail import Mail, Substitution
API_KEY = '<KEY>'
API_KEY_ID = '<KEY>'
ENCODING = "utf-8"
DEFAULT_MAIL="<EMAIL>"
def link(urlsafe):
return "https://develop-dot-autonomus.appspot.com/events/details?event_id=" + urlsafe
def send_newsletter(users, event... | none | 1 | 2.510193 | 3 | |
yellowbrick/features/pca.py | percygautam/yellowbrick | 1 | 1630 | <reponame>percygautam/yellowbrick
# -*- coding: utf-8 -*-
# yellowbrick.features.pca
# Decomposition based feature visualization with PCA.
#
# Author: <NAME>
# Author: <NAME>
# Author: <NAME>
# Created: Tue May 23 18:34:27 2017 -0400
#
# Copyright (C) 2017 The scikit-yb developers
# For license information, see ... | # -*- coding: utf-8 -*-
# yellowbrick.features.pca
# Decomposition based feature visualization with PCA.
#
# Author: <NAME>
# Author: <NAME>
# Author: <NAME>
# Created: Tue May 23 18:34:27 2017 -0400
#
# Copyright (C) 2017 The scikit-yb developers
# For license information, see LICENSE.txt
#
# ID: pca.py [] <EMA... | en | 0.726935 | # -*- coding: utf-8 -*- # yellowbrick.features.pca # Decomposition based feature visualization with PCA. # # Author: <NAME> # Author: <NAME> # Author: <NAME> # Created: Tue May 23 18:34:27 2017 -0400 # # Copyright (C) 2017 The scikit-yb developers # For license information, see LICENSE.txt # # ID: pca.py [] <EMA... | 2.434196 | 2 |
k2/python/host/k2host/properties.py | Jarvan-Wang/k2 | 144 | 1631 | <reponame>Jarvan-Wang/k2<filename>k2/python/host/k2host/properties.py
# Copyright (c) 2020 Xiaomi Corporation (author: <NAME>)
# See ../../../LICENSE for clarification regarding multiple authors
import torch
from torch.utils.dlpack import to_dlpack
from .fsa import Fsa
from _k2host import _is_valid
from _k2host im... | # Copyright (c) 2020 Xiaomi Corporation (author: <NAME>)
# See ../../../LICENSE for clarification regarding multiple authors
import torch
from torch.utils.dlpack import to_dlpack
from .fsa import Fsa
from _k2host import _is_valid
from _k2host import _is_top_sorted
from _k2host import _is_arc_sorted
from _k2host im... | en | 0.697368 | # Copyright (c) 2020 Xiaomi Corporation (author: <NAME>) # See ../../../LICENSE for clarification regarding multiple authors | 1.777012 | 2 |
origamibot/core/teletypes/poll_option.py | cmd410/OrigamiBot | 4 | 1632 | from .base import TelegramStructure, Field
class PollOption(TelegramStructure):
text = Field()
voter_count = Field()
def __init__(self,
text: str,
voter_count: int
):
self.text = \
Field(text, [str])
self.voter_count = \
... | from .base import TelegramStructure, Field
class PollOption(TelegramStructure):
text = Field()
voter_count = Field()
def __init__(self,
text: str,
voter_count: int
):
self.text = \
Field(text, [str])
self.voter_count = \
... | none | 1 | 2.296113 | 2 | |
var/spack/repos/builtin/packages/r-viridislite/package.py | xiki-tempula/spack | 9 | 1633 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RViridislite(RPackage):
"""viridisLite: Default Color Maps from 'matplotlib' (Lite Version... | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RViridislite(RPackage):
"""viridisLite: Default Color Maps from 'matplotlib' (Lite Version... | en | 0.575111 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) viridisLite: Default Color Maps from 'matplotlib' (Lite Version) | 1.42314 | 1 |
shiSock-0.2.0/test_two/PySock/server.py | AnanyaRamanA/shiSock | 0 | 1634 | <reponame>AnanyaRamanA/shiSock
from re import S
import select
import socket
import queue
import threading
import sys
import pickle
import base64
import os
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
from cryptography.hazmat.primitives.serializa... | from re import S
import select
import socket
import queue
import threading
import sys
import pickle
import base64
import os
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
from cryptography.hazmat.primitives.serialization import load_ssh_public_key... | en | 0.531887 | #$%&*?") #cdscypteddatafdrj" async_server initializer class that will create the a asyncronouse tcp server. # thread1.daemon = True # thread2.daemon = True # thread3.daemon = True # thread.daemon = True # handling the inputs # handling the outputs # handling the errors # __receiving_msg = self.__RECEIVING_MSG, # __var... | 2.193218 | 2 |
server/www/packages/packages-windows/x86/ldap3/utils/asn1.py | zhoulhb/teleport | 640 | 1635 | """
"""
# Created on 2015.08.19
#
# Author: <NAME>
#
# Copyright 2015 - 2018 <NAME>
#
# This file is part of ldap3.
#
# ldap3 is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version... | """
"""
# Created on 2015.08.19
#
# Author: <NAME>
#
# Copyright 2015 - 2018 <NAME>
#
# This file is part of ldap3.
#
# ldap3 is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version... | en | 0.743262 | # Created on 2015.08.19 # # Author: <NAME> # # Copyright 2015 - 2018 <NAME> # # This file is part of ldap3. # # ldap3 is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation, either version 3 of the License, or ... | 1.784348 | 2 |
lib/utils/arg_scope.py | SimeonZhang/detectron2_tensorflow | 3 | 1636 | import copy
from contextlib import contextmanager
from functools import wraps
from collections import defaultdict
import tensorflow as tf
_ArgScopeStack = []
@contextmanager
def arg_scope(layers, **kwargs):
"""
Args:
layers (list or layer): layer or list of layers to apply the arguments.
Returns... | import copy
from contextlib import contextmanager
from functools import wraps
from collections import defaultdict
import tensorflow as tf
_ArgScopeStack = []
@contextmanager
def arg_scope(layers, **kwargs):
"""
Args:
layers (list or layer): layer or list of layers to apply the arguments.
Returns... | en | 0.639929 | Args: layers (list or layer): layer or list of layers to apply the arguments. Returns: a context where all appearance of these layer will by default have the arguments specified by kwargs. Example: .. code-block:: python with arg_scope(Conv2D, kernel_shape=3, nl=tf... | 2.76734 | 3 |
CORN-TEST/textfsm_parse.py | AnkitDeshwal89/NETMIKO | 0 | 1637 | <filename>CORN-TEST/textfsm_parse.py
import textfsm
import subprocess
import random
res = subprocess.run('ifconfig',stdout=subprocess.PIPE)
intstatus = res.stdout.decode('ascii')
with open("datafile","w+") as a:
a.write(intstatus)
a.close()
template_file= "ifconfig-template.template"
template = open(templ... | <filename>CORN-TEST/textfsm_parse.py
import textfsm
import subprocess
import random
res = subprocess.run('ifconfig',stdout=subprocess.PIPE)
intstatus = res.stdout.decode('ascii')
with open("datafile","w+") as a:
a.write(intstatus)
a.close()
template_file= "ifconfig-template.template"
template = open(templ... | en | 0.12718 | #Enter template FileName :ifconfig-template.template #Input Data file : ifconfig_output.txt | 2.415934 | 2 |
classes.py | jared-jorgenson/mini_game | 0 | 1638 | import pygame
class Player(pygame.sprite.Sprite):
death = [pygame.image.load('Images/death1.png'), pygame.image.load('Images/death2.png'),
pygame.image.load('Images/death3.png'),
pygame.image.load('Images/death4.png'), pygame.image.load('Images/death5.png'),
pygame.im... | import pygame
class Player(pygame.sprite.Sprite):
death = [pygame.image.load('Images/death1.png'), pygame.image.load('Images/death2.png'),
pygame.image.load('Images/death3.png'),
pygame.image.load('Images/death4.png'), pygame.image.load('Images/death5.png'),
pygame.im... | es | 0.320546 | # Constructor function | 2.391992 | 2 |
installSynApps/data_model/install_config.py | NSLS-II/installSynApps | 0 | 1639 | """A file containing representations of install configurations.
The core Data representation for installSynApps. An InstallConfiguration object
is parsed from a configuration, and is then used throughout the build process.
InjectorFile objects are used for representing text that need to be injected
into configuration... | """A file containing representations of install configurations.
The core Data representation for installSynApps. An InstallConfiguration object
is parsed from a configuration, and is then used throughout the build process.
InjectorFile objects are used for representing text that need to be injected
into configuration... | en | 0.708705 | A file containing representations of install configurations. The core Data representation for installSynApps. An InstallConfiguration object is parsed from a configuration, and is then used throughout the build process. InjectorFile objects are used for representing text that need to be injected into configuration fi... | 2.835656 | 3 |
apps/accounts/views.py | tarvitz/icu | 1 | 1640 | <gh_stars>1-10
# Create your views here.
# -*- coding: utf-8 -*-
from apps.core.helpers import render_to, ajax_response, get_object_or_None
from apps.core.decorators import lock, login_required_json
from apps.accounts.models import Invite
from apps.accounts.decorators import check_invite
from apps.accounts.forms import... | # Create your views here.
# -*- coding: utf-8 -*-
from apps.core.helpers import render_to, ajax_response, get_object_or_None
from apps.core.decorators import lock, login_required_json
from apps.accounts.models import Invite
from apps.accounts.decorators import check_invite
from apps.accounts.forms import (
LoginFor... | en | 0.823816 | # Create your views here. # -*- coding: utf-8 -*- #no mail send, no money :) #@check for possibility to register | 1.947847 | 2 |
plugins/modules/oci_blockstorage_volume_backup_policy_facts.py | LaudateCorpus1/oci-ansible-collection | 0 | 1641 | <reponame>LaudateCorpus1/oci-ansible-collection
#!/usr/bin/python
# Copyright (c) 2020, 2022 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.tx... | #!/usr/bin/python
# Copyright (c) 2020, 2022 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | en | 0.7189 | #!/usr/bin/python # Copyright (c) 2020, 2022 Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Apache License v2.0 # See LICENSE.TXT for d... | 1.606171 | 2 |
pi_control/server_stats/apps.py | mhozza/pi-control | 0 | 1642 | <reponame>mhozza/pi-control<gh_stars>0
from django.apps import AppConfig
class ServerStatsConfig(AppConfig):
name = "server_stats"
| from django.apps import AppConfig
class ServerStatsConfig(AppConfig):
name = "server_stats" | none | 1 | 1.120117 | 1 | |
testproject/testproject/settings.py | jackvz/mezzanine-cartridge-api | 1 | 1643 |
from __future__ import absolute_import, unicode_literals
import os
from django import VERSION as DJANGO_VERSION
from django.utils.translation import ugettext_lazy as _
SECRET_KEY = <KEY>'
######################
# CARTRIDGE SETTINGS #
######################
# The following settings are already defined in cartridge.... |
from __future__ import absolute_import, unicode_literals
import os
from django import VERSION as DJANGO_VERSION
from django.utils.translation import ugettext_lazy as _
SECRET_KEY = <KEY>'
######################
# CARTRIDGE SETTINGS #
######################
# The following settings are already defined in cartridge.... | en | 0.758124 | ###################### # CARTRIDGE SETTINGS # ###################### # The following settings are already defined in cartridge.shop.defaults # with default values, but are common enough to be put here, commented # out, for conveniently overriding. Please consult the settings # documentation for a full list of settings ... | 1.979236 | 2 |
wordgen/data_gen.py | ishaanbakhle/wordgen.us | 0 | 1644 | <gh_stars>0
from wordgen import consts
import numpy as np
from sklearn import preprocessing
def fill_matrix(dataset):
assert type(dataset) == str
assert len(dataset) > 0, print("Dataset must be > 0")
matrix = []
for i in consts.rang:
matrix.append([])
for o in consts.rang:
... | from wordgen import consts
import numpy as np
from sklearn import preprocessing
def fill_matrix(dataset):
assert type(dataset) == str
assert len(dataset) > 0, print("Dataset must be > 0")
matrix = []
for i in consts.rang:
matrix.append([])
for o in consts.rang:
matrix[i]... | en | 0.70993 | # if (dataset[i+1] in accepted and dataset[i] in accepted): | 3.112562 | 3 |
arcade/gl/context.py | Cleptomania/arcade | 0 | 1645 | <filename>arcade/gl/context.py
from ctypes import c_int, c_char_p, cast, c_float
from collections import deque
import logging
import weakref
from typing import Any, Dict, List, Tuple, Union, Sequence, Set
import pyglet
from pyglet.window import Window
from pyglet import gl
from .buffer import Buffer
from .program imp... | <filename>arcade/gl/context.py
from ctypes import c_int, c_char_p, cast, c_float
from collections import deque
import logging
import weakref
from typing import Any, Dict, List, Tuple, Union, Sequence, Set
import pyglet
from pyglet.window import Window
from pyglet import gl
from .buffer import Buffer
from .program imp... | en | 0.664625 | Represents an OpenGL context. This context belongs to a ``pyglet.Window`` normally accessed through ``window.ctx``. The Context class contains methods for creating resources, global states and commonly used enums. All enums also exist in the ``gl`` module. (``ctx.BLEND`` or ``arcade.gl.BLEND``). #: The... | 2.068692 | 2 |
api/app/models/bookings/exam.py | pixelater/queue-management | 0 | 1646 | <reponame>pixelater/queue-management
'''Copyright 2018 Province of British Columbia
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 ap... | '''Copyright 2018 Province of British Columbia
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,... | en | 0.863408 | Copyright 2018 Province of British Columbia Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, so... | 1.791652 | 2 |
leetcode/1672 Richest Customer Wealth.py | jaredliw/python-question-bank | 1 | 1647 | <filename>leetcode/1672 Richest Customer Wealth.py
class Solution(object):
def maximumWealth(self, accounts):
"""
:type accounts: List[List[int]]
:rtype: int
"""
# Runtime: 36 ms
# Memory: 13.5 MB
return max(map(sum, accounts))
| <filename>leetcode/1672 Richest Customer Wealth.py
class Solution(object):
def maximumWealth(self, accounts):
"""
:type accounts: List[List[int]]
:rtype: int
"""
# Runtime: 36 ms
# Memory: 13.5 MB
return max(map(sum, accounts))
| en | 0.406133 | :type accounts: List[List[int]] :rtype: int # Runtime: 36 ms # Memory: 13.5 MB | 3.095936 | 3 |
datatableview/tests/test_helpers.py | gregneagle/sal | 2 | 1648 | <filename>datatableview/tests/test_helpers.py
# -*- encoding: utf-8 -*-
from datetime import datetime
from functools import partial
from django import get_version
from datatableview import helpers
import six
from .testcase import DatatableViewTestCase
from .test_app.models import ExampleModel, RelatedM2MModel
if ... | <filename>datatableview/tests/test_helpers.py
# -*- encoding: utf-8 -*-
from datetime import datetime
from functools import partial
from django import get_version
from datatableview import helpers
import six
from .testcase import DatatableViewTestCase
from .test_app.models import ExampleModel, RelatedM2MModel
if ... | en | 0.635211 | # -*- encoding: utf-8 -*- Verifies that link_to_model works. # Verify that a model without get_absolute_url() raises a complaint # Verify simple use # Verify text override # Verify ``key`` access to transition an instance to a related field # Verify ``key`` access version of custom text Verifies that make_boolean_check... | 2.395758 | 2 |
discordbot.py | naari3/seibaribot | 0 | 1649 | <reponame>naari3/seibaribot
import traceback
from os import getenv
import discord
from discord import Message
from discord.ext import commands
from discord.ext.commands import Context
from asyncio import sleep
import asyncio
client = discord.Client()
# botの接頭辞を!にする
bot = commands.Bot(command_prefix='!')
# ギラティナのチャンネ... | import traceback
from os import getenv
import discord
from discord import Message
from discord.ext import commands
from discord.ext.commands import Context
from asyncio import sleep
import asyncio
client = discord.Client()
# botの接頭辞を!にする
bot = commands.Bot(command_prefix='!')
# ギラティナのチャンネルのID
GIRATINA_CHANNEL_ID = 9... | ja | 0.992348 | # botの接頭辞を!にする # ギラティナのチャンネルのID # 起動時のメッセージの関数 # Bot起動時に実行される関数 # ピンポン # 送信者がBotである場合は弾く # ドナルドの言葉狩り - https://qiita.com/sizumita/items/9d44ae7d1ce007391699 # メッセージの本文が ドナルド だった場合 # 送信するメッセージをランダムで決める # メッセージが送られてきたチャンネルに送る # メッセージに場合 # Attachmentの拡張子がmp3, wavのどれかだった場合 # https://discordpy.readthedocs.io/ja/latest/api.h... | 2.30961 | 2 |
test/cpp/naming/utils/dns_server.py | arghyadip01/grpc | 9 | 1650 | #!/usr/bin/env python2.7
# Copyright 2015 gRPC 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 applicable la... | #!/usr/bin/env python2.7
# Copyright 2015 gRPC 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 applicable la... | en | 0.800185 | #!/usr/bin/env python2.7 # Copyright 2015 gRPC 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 applicable la... | 2.168125 | 2 |
colour/examples/models/examples_ictcp.py | BPearlstine/colour | 2 | 1651 | # -*- coding: utf-8 -*-
"""
Showcases *ICTCP* *colour encoding* computations.
"""
import numpy as np
import colour
from colour.utilities import message_box
message_box('"ICTCP" Colour Encoding Computations')
RGB = np.array([0.45620519, 0.03081071, 0.04091952])
message_box(('Converting from "ITU-R BT.2020" colourspa... | # -*- coding: utf-8 -*-
"""
Showcases *ICTCP* *colour encoding* computations.
"""
import numpy as np
import colour
from colour.utilities import message_box
message_box('"ICTCP" Colour Encoding Computations')
RGB = np.array([0.45620519, 0.03081071, 0.04091952])
message_box(('Converting from "ITU-R BT.2020" colourspa... | en | 0.505548 | # -*- coding: utf-8 -*- Showcases *ICTCP* *colour encoding* computations. | 3.09126 | 3 |
app/core/model/routine.py | MauricioAntonioMartinez/django-workout-tracker-api | 0 | 1652 | <reponame>MauricioAntonioMartinez/django-workout-tracker-api
import os
import uuid
from django.conf import settings # this is how we can retrive variables
# for the settings file
from django.contrib.auth.models import (AbstractBaseUser, BaseUserManager,
PermissionsMixin)
from ... | import os
import uuid
from django.conf import settings # this is how we can retrive variables
# for the settings file
from django.contrib.auth.models import (AbstractBaseUser, BaseUserManager,
PermissionsMixin)
from django.core.validators import MaxValueValidator, MinValueValid... | en | 0.900643 | # this is how we can retrive variables # for the settings file # Maneger User class is the class that provides the creation # of user or admin and all methods out of the box | 2.154959 | 2 |
example_scripts/transect_tutorial.py | British-Oceanographic-Data-Centre/COAsT | 8 | 1653 | """
This is a demonstration script for using the Transect class in the COAsT
package. This object has strict data formatting requirements, which are
outlined in tranect.py.
Transect subsetting (a vertical slice of data between two coordinates): Creating them and performing some custom diagnostics with them.
---
In ... | """
This is a demonstration script for using the Transect class in the COAsT
package. This object has strict data formatting requirements, which are
outlined in tranect.py.
Transect subsetting (a vertical slice of data between two coordinates): Creating them and performing some custom diagnostics with them.
---
In ... | en | 0.895204 | This is a demonstration script for using the Transect class in the COAsT package. This object has strict data formatting requirements, which are outlined in tranect.py. Transect subsetting (a vertical slice of data between two coordinates): Creating them and performing some custom diagnostics with them. --- In this... | 3.264641 | 3 |
diofant/logic/boolalg.py | skirpichev/diofant | 0 | 1654 | <gh_stars>0
"""
Boolean algebra module for Diofant.
"""
from collections import defaultdict
from itertools import combinations, product
from ..core import Atom, cacheit
from ..core.expr import Expr
from ..core.function import Application
from ..core.numbers import Number
from ..core.operations import LatticeOp
from .... | """
Boolean algebra module for Diofant.
"""
from collections import defaultdict
from itertools import combinations, product
from ..core import Atom, cacheit
from ..core.expr import Expr
from ..core.function import Application
from ..core.numbers import Number
from ..core.operations import LatticeOp
from ..core.single... | en | 0.776105 | Boolean algebra module for Diofant. A boolean object is an object for which logic operations make sense. Overloading for & operator. Overloading for | operator. Overloading for ~ operator. Overloading for >> operator. Overloading for << operator. Returns True if the given formulas have the same truth table. For... | 3.190731 | 3 |
amazon/goods_review_thread.py | JoanLee0826/amazon | 5 | 1655 | <gh_stars>1-10
import pandas as pd
import requests
from lxml import etree
import re, time, random, datetime
from queue import Queue
import threading
class Review:
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 \
(KHTML, like Gecko) Chrome/69.0.3497.81 ... | import pandas as pd
import requests
from lxml import etree
import re, time, random, datetime
from queue import Queue
import threading
class Review:
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 \
(KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36"
... | zh | 0.644207 | # 商品评价名称 # 商品评价容器 # 评价人 # 评价星级 # 评价title # 评价日期 # 评价内容 # 评价有用数量 # 商品的评价信息表 # print(self.view_list[-1]) # goods_data.drop_duplicates(subset=['r','评价数量'],inplace=True) | 2.866433 | 3 |
lumicks/pylake/population/tests/conftest.py | lumicks/pylake | 8 | 1656 | import pytest
import numpy as np
from pathlib import Path
def extract_param(data, n_states):
keys = ("initial_state_prob", "transition_prob", "means", "st_devs")
param = {"n_states": n_states}
for key in keys:
param[key] = data[f"{key}_{n_states}"]
return param
@pytest.fixture(scope="session... | import pytest
import numpy as np
from pathlib import Path
def extract_param(data, n_states):
keys = ("initial_state_prob", "transition_prob", "means", "st_devs")
param = {"n_states": n_states}
for key in keys:
param[key] = data[f"{key}_{n_states}"]
return param
@pytest.fixture(scope="session... | en | 0.578026 | Trace data can be generated by running ./data/generate_trace_data.py Trace data can be generated by running ./data/generate_trace_data.py | 2.12564 | 2 |
Concurrent/PipelineDecomposingTask.py | rafagarciac/ParallelProgrammingPython | 0 | 1657 | <reponame>rafagarciac/ParallelProgrammingPython
#!/usr/bin/env python
"""
Artesanal example Pipe without Pipe class.
"""
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__copyright__ = "Copyright (c) 2018 <NAME>"
__license__ = "MIT"
from concurrent.futures import ProcessPoolExecutor
import time
import random
def wo... | #!/usr/bin/env python
"""
Artesanal example Pipe without Pipe class.
"""
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__copyright__ = "Copyright (c) 2018 <NAME>"
__license__ = "MIT"
from concurrent.futures import ProcessPoolExecutor
import time
import random
def worker(arg):
time.sleep(random.random())
r... | en | 0.513625 | #!/usr/bin/env python Artesanal example Pipe without Pipe class. # Fix multiprocessing in Spyder's IPython # pool = ProcessPoolExecutor([max_workers]) # pools[0].submit(worker, random.random()).add_done_callback(pipeline) # pool.shutdown() | 2.924791 | 3 |
src/digibujogens/__main__.py | roaet/digibujogens | 0 | 1658 | """ Main application entry point.
python -m digibujogens ...
"""
def main():
""" Execute the application.
"""
raise NotImplementedError
# Make the script executable.
if __name__ == "__main__":
raise SystemExit(main())
| """ Main application entry point.
python -m digibujogens ...
"""
def main():
""" Execute the application.
"""
raise NotImplementedError
# Make the script executable.
if __name__ == "__main__":
raise SystemExit(main())
| en | 0.696493 | Main application entry point. python -m digibujogens ... Execute the application. # Make the script executable. | 2.15901 | 2 |
lisa/target.py | mrkajetanp/lisa | 0 | 1659 | # SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2018, ARM Limited and contributors.
#
# 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
#
# ... | # SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2018, ARM Limited and contributors.
#
# 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
#
# ... | en | 0.807476 | # SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2018, ARM Limited and contributors. # # 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 # # ... | 1.641883 | 2 |
iota/commands/core/get_node_info.py | EasonC13/iota.py | 347 | 1660 | import filters as f
from iota import TransactionHash, Address
from iota.commands import FilterCommand, RequestFilter, ResponseFilter
from iota.filters import Trytes
__all__ = [
'GetNodeInfoCommand',
]
class GetNodeInfoCommand(FilterCommand):
"""
Executes `getNodeInfo` command.
See :py:meth:`iota.ap... | import filters as f
from iota import TransactionHash, Address
from iota.commands import FilterCommand, RequestFilter, ResponseFilter
from iota.filters import Trytes
__all__ = [
'GetNodeInfoCommand',
]
class GetNodeInfoCommand(FilterCommand):
"""
Executes `getNodeInfo` command.
See :py:meth:`iota.ap... | en | 0.692384 | Executes `getNodeInfo` command. See :py:meth:`iota.api.StrictIota.get_node_info`. # ``getNodeInfo`` does not accept any parameters. # Using a filter here just to enforce that the request is empty. | 2.332455 | 2 |
Aplicacion/Presentacion/views.py | Juandiegordp/TPI | 0 | 1661 | from Negocio import controller
import forms, functions
from flask import Flask, render_template, request, redirect, url_for, flash
def register(mysql, request):
registerForm= forms.RegisterForm(request.form)
if request.method == 'POST' and registerForm.validate():
return controller.registraUsuario(mysql... | from Negocio import controller
import forms, functions
from flask import Flask, render_template, request, redirect, url_for, flash
def register(mysql, request):
registerForm= forms.RegisterForm(request.form)
if request.method == 'POST' and registerForm.validate():
return controller.registraUsuario(mysql... | none | 1 | 2.620304 | 3 | |
evalme/tests/test_old_format.py | heartexlabs/label-studio-evalme | 3 | 1662 | <filename>evalme/tests/test_old_format.py
from evalme.matcher import Matcher
def test_old_format_agreement_matrix():
m = Matcher(new_format=False)
m.load(r"./tests/test_data/test_old_format.json")
matrix = m.get_annotations_agreement()
assert matrix is not None
assert matrix > 0
def test_old_fo... | <filename>evalme/tests/test_old_format.py
from evalme.matcher import Matcher
def test_old_format_agreement_matrix():
m = Matcher(new_format=False)
m.load(r"./tests/test_data/test_old_format.json")
matrix = m.get_annotations_agreement()
assert matrix is not None
assert matrix > 0
def test_old_fo... | none | 1 | 2.533631 | 3 | |
behave/runner.py | wombat70/behave | 13 | 1663 | # -*- coding: UTF-8 -*-
"""
This module provides Runner class to run behave feature files (or model elements).
"""
from __future__ import absolute_import, print_function, with_statement
import contextlib
import os.path
import sys
import warnings
import weakref
import six
from behave._types import ExceptionUtil
from... | # -*- coding: UTF-8 -*-
"""
This module provides Runner class to run behave feature files (or model elements).
"""
from __future__ import absolute_import, print_function, with_statement
import contextlib
import os.path
import sys
import warnings
import weakref
import six
from behave._types import ExceptionUtil
from... | en | 0.742847 | # -*- coding: UTF-8 -*- This module provides Runner class to run behave feature files (or model elements). # -- USE PYTHON3 BACKPORT: With unicode traceback support. Raised if a context variable is being overwritten in some situations. If the variable was originally set by user code then this will be raised if ... | 2.357324 | 2 |
01_P/P_2_1_1_02/main.py | genfifth/generative-design_Code-Package-Python-Mode | 1 | 1664 | add_library('pdf')
import random
from datetime import datetime
tileCount = 20
def setup():
global savePDF, actStrokeCap, actRandomSeed, colorLeft, colorRight, alphaLeft, alphaRight
savePDF = False
actStrokeCap = ROUND
actRandomSeed = 0
colorLeft = color(197, 0, 123)
colorRight = color(87, 35,... | add_library('pdf')
import random
from datetime import datetime
tileCount = 20
def setup():
global savePDF, actStrokeCap, actRandomSeed, colorLeft, colorRight, alphaLeft, alphaRight
savePDF = False
actStrokeCap = ROUND
actRandomSeed = 0
colorLeft = color(197, 0, 123)
colorRight = color(87, 35,... | none | 1 | 2.776134 | 3 | |
core/dbt/contracts/graph/manifest.py | peiwangdb/dbt | 0 | 1665 | import enum
from dataclasses import dataclass, field
from itertools import chain, islice
from mashumaro import DataClassMessagePackMixin
from multiprocessing.synchronize import Lock
from typing import (
Dict, List, Optional, Union, Mapping, MutableMapping, Any, Set, Tuple,
TypeVar, Callable, Iterable, Generic, ... | import enum
from dataclasses import dataclass, field
from itertools import chain, islice
from mashumaro import DataClassMessagePackMixin
from multiprocessing.synchronize import Lock
from typing import (
Dict, List, Optional, Union, Mapping, MutableMapping, Any, Set, Tuple,
TypeVar, Callable, Iterable, Generic, ... | en | 0.877888 | # model, seed, snapshot # refables are actually unique, so the Dict[PackageName, UniqueID] will # only ever have exactly one value, but doing 3 dict lookups instead of 1 # is not a big deal at all and retains consistency Metadata for the manifest. Given a dictionary, sort each value. This makes output deterministic, ... | 1.469084 | 1 |
openGaussBase/testcase/SQL/DCL/Alter_Default_Privileges/Opengauss_Function_Alter_Default_Privileges_Case0016.py | opengauss-mirror/Yat | 0 | 1666 | """
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | """
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | en | 0.250986 | Copyright (c) 2022 Huawei Technologies Co.,Ltd. openGauss is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2 THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHO... | 1.756548 | 2 |
Apps/phdigitalshadows/dsapi/service/infrastructure_service.py | ryanbsaunders/phantom-apps | 74 | 1667 | # File: infrastructure_service.py
#
# Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)
#
from .ds_base_service import DSBaseService
from .ds_find_service import DSFindService
from ..model.infrastructure import Infrastructure
class InfrastructureService(DSFindService):
def __init__(se... | # File: infrastructure_service.py
#
# Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)
#
from .ds_base_service import DSBaseService
from .ds_find_service import DSFindService
from ..model.infrastructure import Infrastructure
class InfrastructureService(DSFindService):
def __init__(se... | en | 0.668792 | # File: infrastructure_service.py # # Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt) # Streams all infrastructure objects retrieved from the Digital Shadows API. :param view: InfrastructureView :return: Infrastructure generator Streams all infrastructure objects retrieved f... | 2.022715 | 2 |
src/find_genes_by_location/find_genes_by_location.py | NCBI-Codeathons/Identify-antiphage-defense-systems-in-the-bacterial-pangenome | 3 | 1668 | import argparse
from collections import defaultdict
import csv
from dataclasses import dataclass, field
from enum import Enum, unique, auto
import os
import sys
import tempfile
import yaml
import zipfile
import gffutils
from google.protobuf import json_format
from ncbi.datasets.v1alpha1 import dataset_catalog_pb2
from... | import argparse
from collections import defaultdict
import csv
from dataclasses import dataclass, field
from enum import Enum, unique, auto
import os
import sys
import tempfile
import yaml
import zipfile
import gffutils
from google.protobuf import json_format
from ncbi.datasets.v1alpha1 import dataset_catalog_pb2
from... | none | 1 | 2.269252 | 2 | |
web/backend/backend_django/apps/capacity/models.py | tOverney/ADA-Project | 0 | 1669 | <filename>web/backend/backend_django/apps/capacity/models.py
from django.db import models
from multigtfs.models import (
Block, Fare, FareRule, Feed, Frequency, Route, Service, ServiceDate, Shape,
ShapePoint, Stop, StopTime, Trip, Agency)
class Path(models.Model):
trip = models.ForeignKey(Trip)
stop ... | <filename>web/backend/backend_django/apps/capacity/models.py
from django.db import models
from multigtfs.models import (
Block, Fare, FareRule, Feed, Frequency, Route, Service, ServiceDate, Shape,
ShapePoint, Stop, StopTime, Trip, Agency)
class Path(models.Model):
trip = models.ForeignKey(Trip)
stop ... | none | 1 | 2.212135 | 2 | |
apps/interface/settings/config.py | rainydaygit/testtcloudserver | 349 | 1670 | try:
from public_config import *
except ImportError:
pass
PORT = 9028
SERVICE_NAME = 'interface'
| try:
from public_config import *
except ImportError:
pass
PORT = 9028
SERVICE_NAME = 'interface'
| none | 1 | 1.22467 | 1 | |
api/api/pokemon/views.py | farnswj1/PokemonAPI | 0 | 1671 | <filename>api/api/pokemon/views.py
from django.utils.decorators import method_decorator
from django.views.decorators.cache import cache_page
from rest_framework.generics import (
ListAPIView,
RetrieveAPIView,
CreateAPIView,
UpdateAPIView,
DestroyAPIView
)
from .models import Pokemon
from .serializer... | <filename>api/api/pokemon/views.py
from django.utils.decorators import method_decorator
from django.views.decorators.cache import cache_page
from rest_framework.generics import (
ListAPIView,
RetrieveAPIView,
CreateAPIView,
UpdateAPIView,
DestroyAPIView
)
from .models import Pokemon
from .serializer... | en | 0.968116 | # Create your views here. | 2.193316 | 2 |
plugins/action/normalize_gitlab_cfg.py | sma-de/ansible-collections-gitlab | 0 | 1672 | <gh_stars>0
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.errors import AnsibleOptionsError
from ansible.module_utils.six import iteritems, string_types
from ansible_collections.smabot.base.plugins.module_utils.plugins.config_normalizing.base import ConfigNorma... | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.errors import AnsibleOptionsError
from ansible.module_utils.six import iteritems, string_types
from ansible_collections.smabot.base.plugins.module_utils.plugins.config_normalizing.base import ConfigNormalizerBaseMerg... | en | 0.652086 | ## note: for recursive structures, the sub normalizers can only ## be instantiated if the corresponding key actually exists ## to avoid indefinite recursions of death # do config subkey # build role hierarchy path and parent ## top level ## subrole ## if it exists, members should be a dict where the keys are ## val... | 1.825917 | 2 |
microservices/validate/tools/dynamodb.py | clodonil/pipeline_aws_custom | 0 | 1673 | <filename>microservices/validate/tools/dynamodb.py
"""
Tools de integração com o Dynamodb
"""
import boto3
import botocore
import logging
import datetime
import json
import copy
import time
import os
class DyConnect:
def __init__(self, table, region):
self.table = table
self.region = region
d... | <filename>microservices/validate/tools/dynamodb.py
"""
Tools de integração com o Dynamodb
"""
import boto3
import botocore
import logging
import datetime
import json
import copy
import time
import os
class DyConnect:
def __init__(self, table, region):
self.table = table
self.region = region
d... | pt | 0.929171 | Tools de integração com o Dynamodb | 2.241577 | 2 |
scrapy_ddiy/spiders/GlidedSky/glided_sky_001.py | LZC6244/scrapy_ddiy | 9 | 1674 | # -*- coding: utf-8 -*-
from scrapy import Request
from scrapy_ddiy.utils.spiders.ddiy_base import DdiyBaseSpider
class GlidedSky001Spider(DdiyBaseSpider):
name = 'glided_sky_001'
description = 'GlidedSky 爬虫-基础1'
start_url = 'http://www.glidedsky.com/level/web/crawler-basic-1'
custom_settings = {
... | # -*- coding: utf-8 -*-
from scrapy import Request
from scrapy_ddiy.utils.spiders.ddiy_base import DdiyBaseSpider
class GlidedSky001Spider(DdiyBaseSpider):
name = 'glided_sky_001'
description = 'GlidedSky 爬虫-基础1'
start_url = 'http://www.glidedsky.com/level/web/crawler-basic-1'
custom_settings = {
... | en | 0.769321 | # -*- coding: utf-8 -*- | 2.695102 | 3 |
datasets/celeba/celeba_dataset.py | google/joint_vae | 35 | 1675 | #
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | #
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | en | 0.798556 | # # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin... | 2.310919 | 2 |
jorldy/manager/log_manager.py | kan-s0/JORLDY | 0 | 1676 | <filename>jorldy/manager/log_manager.py
import os
import datetime, time
import imageio
from pygifsicle import optimize
from torch.utils.tensorboard import SummaryWriter
class LogManager:
def __init__(self, env, id, experiment=None):
self.id = id
now = datetime.datetime.now().strftime("%Y%m%d%H%M%... | <filename>jorldy/manager/log_manager.py
import os
import datetime, time
import imageio
from pygifsicle import optimize
from torch.utils.tensorboard import SummaryWriter
class LogManager:
def __init__(self, env, id, experiment=None):
self.id = id
now = datetime.datetime.now().strftime("%Y%m%d%H%M%... | none | 1 | 2.265533 | 2 | |
lib/SeparateDriver/ASRDriverParts/UNIInterface.py | multi-service-fabric/element-manager | 0 | 1677 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright(c) 2019 Nippon Telegraph and Telephone Corporation
# Filename: ASRDriverParts/UNIInterface.py
'''
Parts Module for ASR driver UNI interface configuraton
'''
import GlobalModule
from EmCommonLog import decorater_log
from ASRDriverParts.InterfaceBase im... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright(c) 2019 Nippon Telegraph and Telephone Corporation
# Filename: ASRDriverParts/UNIInterface.py
'''
Parts Module for ASR driver UNI interface configuraton
'''
import GlobalModule
from EmCommonLog import decorater_log
from ASRDriverParts.InterfaceBase im... | en | 0.6626 | #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright(c) 2019 Nippon Telegraph and Telephone Corporation # Filename: ASRDriverParts/UNIInterface.py Parts Module for ASR driver UNI interface configuraton Parts class for ASR driver UNI interface configuraton Costructor Command line to add configuration is output. Par... | 1.997286 | 2 |
tools/accuracy_checker/accuracy_checker/annotation_converters/mnist.py | AnthonyQuantum/open_model_zoo | 4 | 1678 | """
Copyright (c) 2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,... | """
Copyright (c) 2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,... | en | 0.783501 | Copyright (c) 2019 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, sof... | 2.346245 | 2 |
Libraries/Python/wxGlade/v0.9,5/wxGlade-0.9.5-py3.6.egg/wxglade/bugdialog.py | davidbrownell/Common_EnvironmentEx | 0 | 1679 | <reponame>davidbrownell/Common_EnvironmentEx
"""\
Dialog to show details of internal errors.
@copyright: 2014-2016 <NAME>
@copyright: 2017 <NAME>
@license: MIT (see LICENSE.txt) - THIS PROGRAM COMES WITH NO WARRANTY
"""
import bugdialog_ui
import config
import log
import logging
import sys
import wx
class BugRepor... | """\
Dialog to show details of internal errors.
@copyright: 2014-2016 <NAME>
@copyright: 2017 <NAME>
@license: MIT (see LICENSE.txt) - THIS PROGRAM COMES WITH NO WARRANTY
"""
import bugdialog_ui
import config
import log
import logging
import sys
import wx
class BugReport(bugdialog_ui.UIBugDialog):
"Dialog to s... | en | 0.672925 | \ Dialog to show details of internal errors. @copyright: 2014-2016 <NAME> @copyright: 2017 <NAME> @license: MIT (see LICENSE.txt) - THIS PROGRAM COMES WITH NO WARRANTY # Flag to prevent dialog popups during test runs. Prepare given exception information and show it as dialog content. msg: Short description of... | 2.405497 | 2 |
core/views.py | Neelamegam2000/QRcode-for-license | 0 | 1680 | <filename>core/views.py
from django.shortcuts import render, redirect
from django.conf import settings
from django.core.files.storage import FileSystemStorage,default_storage
from django.core.mail import send_mail, EmailMessage
from core.models import Document
from core.forms import DocumentForm
from django.contrib i... | <filename>core/views.py
from django.shortcuts import render, redirect
from django.conf import settings
from django.core.files.storage import FileSystemStorage,default_storage
from django.core.mail import send_mail, EmailMessage
from core.models import Document
from core.forms import DocumentForm
from django.contrib i... | en | 0.336349 | def simple_upload(request): if request.method == 'POST' and request.FILES['myfile']: myfile = request.FILES['myfile'] fs = FileSystemStorage() filename = fs.save(myfile.name, myfile) uploaded_file_url = fs.url(filename) BASE_DIR = os.path.dirname(os.path.dirname(os.path.... | 2.223079 | 2 |
docassemble/MACourts/__init__.py | nonprofittechy/docassemble-MACourts | 2 | 1681 | <filename>docassemble/MACourts/__init__.py<gh_stars>1-10
__version__ = '0.0.58.2'
| <filename>docassemble/MACourts/__init__.py<gh_stars>1-10
__version__ = '0.0.58.2'
| none | 1 | 1.152071 | 1 | |
main.py | Meat0Project/ChatBot | 4 | 1682 | '''
Made by - <NAME>
Purpose - Python mini project
Date - 18 october 2020
'''
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
form termcolor import cprint
import time
chatbot = ChatBot('Bot')
trainer = ChatterBotCorpusTrainer(chatbot)
trainer.train('chatterbot.corpus.english')
... | '''
Made by - <NAME>
Purpose - Python mini project
Date - 18 october 2020
'''
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
form termcolor import cprint
import time
chatbot = ChatBot('Bot')
trainer = ChatterBotCorpusTrainer(chatbot)
trainer.train('chatterbot.corpus.english')
... | en | 0.546897 | Made by - <NAME> Purpose - Python mini project Date - 18 october 2020 | 2.953158 | 3 |
challenges/day14.py | Jeffreyo3/AdventOfCode2020 | 0 | 1683 | <reponame>Jeffreyo3/AdventOfCode2020
"""
--- Day 14: Docking Data ---
As your ferry approaches the sea port, the captain asks for your help again. The computer system that runs this port isn't compatible with the docking program on the ferry, so the docking parameters aren't being correctly initialized in the docking p... | """
--- Day 14: Docking Data ---
As your ferry approaches the sea port, the captain asks for your help again. The computer system that runs this port isn't compatible with the docking program on the ferry, so the docking parameters aren't being correctly initialized in the docking program's memory.
After a brief inspe... | en | 0.867066 | --- Day 14: Docking Data --- As your ferry approaches the sea port, the captain asks for your help again. The computer system that runs this port isn't compatible with the docking program on the ferry, so the docking parameters aren't being correctly initialized in the docking program's memory. After a brief inspectio... | 3.83253 | 4 |
src/Dialogs/RegularPolygonDialog.py | Lovely-XPP/tkzgeom | 41 | 1684 | from PyQt5 import QtWidgets, uic
from Factory import Factory
from Dialogs.DialogMacros import turn_into_free_point, free_point_checkbox
from Fill.ListWidget import fill_listWidget_with_data, set_selected_id_in_listWidget
import Constant as c
class RegularPolygonDialog(QtWidgets.QDialog):
def __init__(self, scene... | from PyQt5 import QtWidgets, uic
from Factory import Factory
from Dialogs.DialogMacros import turn_into_free_point, free_point_checkbox
from Fill.ListWidget import fill_listWidget_with_data, set_selected_id_in_listWidget
import Constant as c
class RegularPolygonDialog(QtWidgets.QDialog):
def __init__(self, scene... | en | 0.662977 | Construct RegularPolygonDialog. Be slider callback function to set sides. Create new regular polygon with settings. Add no new regular polygon. | 2.32523 | 2 |
tests/test_networks.py | UCY-LINC-LAB/5G-Slicer | 0 | 1685 | import unittest
from networks.QoS import QoS
from networks.connections.mathematical_connections import FunctionalDegradation
from networks.slicing import SliceConceptualGraph
from utils.location import Location
class TestBaseStationLinear(unittest.TestCase):
def setUp(self):
self.name = "network"
... | import unittest
from networks.QoS import QoS
from networks.connections.mathematical_connections import FunctionalDegradation
from networks.slicing import SliceConceptualGraph
from utils.location import Location
class TestBaseStationLinear(unittest.TestCase):
def setUp(self):
self.name = "network"
... | none | 1 | 2.935545 | 3 | |
backend/api/management/commands/create_testdb.py | INSRapperswil/nornir-web | 2 | 1686 | """
Setup DB with example data for tests
"""
from django.contrib.auth.hashers import make_password
from django.contrib.auth.models import User, Group
from django.core.management.base import BaseCommand
from api import models
class Command(BaseCommand):
help = 'Setup DB with example data for tests'
... | """
Setup DB with example data for tests
"""
from django.contrib.auth.hashers import make_password
from django.contrib.auth.models import User, Group
from django.core.management.base import BaseCommand
from api import models
class Command(BaseCommand):
help = 'Setup DB with example data for tests'
... | en | 0.813375 | Setup DB with example data for tests | 2.424835 | 2 |
pyinfra/facts/util/distro.py | charles-l/pyinfra | 1 | 1687 | from __future__ import absolute_import, unicode_literals
import os
import distro
def get_distro_info(root_dir):
# We point _UNIXCONFDIR to root_dir
old_value = distro._UNIXCONFDIR
distro._UNIXCONFDIR = os.path.join(root_dir, 'etc')
obj = distro.LinuxDistribution(include_lsb=False, include_uname=Fal... | from __future__ import absolute_import, unicode_literals
import os
import distro
def get_distro_info(root_dir):
# We point _UNIXCONFDIR to root_dir
old_value = distro._UNIXCONFDIR
distro._UNIXCONFDIR = os.path.join(root_dir, 'etc')
obj = distro.LinuxDistribution(include_lsb=False, include_uname=Fal... | en | 0.752481 | # We point _UNIXCONFDIR to root_dir # NOTE: The parsing of LinuxDistribution distro information is done in a lazy way. # This will force the parsing to happen before we restore the old value of _UNIXCONFDIR. | 2.142607 | 2 |
appium/webdriver/common/multi_action.py | salabogdan/python-client | 1 | 1688 | <reponame>salabogdan/python-client
#!/usr/bin/env python
# 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 la... | #!/usr/bin/env python
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | en | 0.729624 | #!/usr/bin/env python # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ... | 2.58779 | 3 |
src/visu/visualizer.py | JonasFrey96/PLR2 | 0 | 1689 | import numpy as np
import sys
import os
from PIL import Image
from visu.helper_functions import save_image
from scipy.spatial.transform import Rotation as R
from helper import re_quat
import copy
import torch
import numpy as np
import k3d
class Visualizer():
def __init__(self, p_visu, writer=None):
if p_v... | import numpy as np
import sys
import os
from PIL import Image
from visu.helper_functions import save_image
from scipy.spatial.transform import Rotation as R
from helper import re_quat
import copy
import torch
import numpy as np
import k3d
class Visualizer():
def __init__(self, p_visu, writer=None):
if p_v... | en | 0.600223 | tag := tensorboard tag epoch := tensorboard epoche store := ture -> stores the image to standard path path := != None creats the path and store to it path/tag.png img:= original_image, [widht,height,RGB] points:= points of the object model [length,x,y,z] trans: [1,3] ... | 2.192849 | 2 |
leetCode_Q37_serializeTree.py | FreesiaLikesPomelo/-offer | 0 | 1690 | <reponame>FreesiaLikesPomelo/-offer
'''
面试题37. 序列化二叉树
请实现两个函数,分别用来序列化和反序列化二叉树。
示例:
你可以将以下二叉树:
1
/ \
2 3
/ \
4 5
序列化为 "[1,2,3,null,null,4,5]"
'''
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# ... | '''
面试题37. 序列化二叉树
请实现两个函数,分别用来序列化和反序列化二叉树。
示例:
你可以将以下二叉树:
1
/ \
2 3
/ \
4 5
序列化为 "[1,2,3,null,null,4,5]"
'''
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
# 执行用时 :240 ms... | en | 0.347402 | 面试题37. 序列化二叉树 请实现两个函数,分别用来序列化和反序列化二叉树。 示例: 你可以将以下二叉树: 1 / \ 2 3 / \ 4 5 序列化为 "[1,2,3,null,null,4,5]" # Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None # 执行用时 :240 ms, 在所有 Pyth... | 3.852946 | 4 |
ipuz/puzzlekinds/__init__.py | maiamcc/ipuz | 5 | 1691 | <gh_stars>1-10
from .acrostic import IPUZ_ACROSTIC_VALIDATORS
from .answer import IPUZ_ANSWER_VALIDATORS
from .block import IPUZ_BLOCK_VALIDATORS
from .crossword import IPUZ_CROSSWORD_VALIDATORS
from .fill import IPUZ_FILL_VALIDATORS
from .sudoku import IPUZ_SUDOKU_VALIDATORS
from .wordsearch import IPUZ_WORDSEARCH_VAL... | from .acrostic import IPUZ_ACROSTIC_VALIDATORS
from .answer import IPUZ_ANSWER_VALIDATORS
from .block import IPUZ_BLOCK_VALIDATORS
from .crossword import IPUZ_CROSSWORD_VALIDATORS
from .fill import IPUZ_FILL_VALIDATORS
from .sudoku import IPUZ_SUDOKU_VALIDATORS
from .wordsearch import IPUZ_WORDSEARCH_VALIDATORS
IPUZ_... | none | 1 | 2.095664 | 2 | |
CTFd/api/v1/users.py | MrQubo/CTFd | 0 | 1692 | <filename>CTFd/api/v1/users.py
from flask import session, request, abort
from flask_restplus import Namespace, Resource
from CTFd.models import (
db,
Users,
Solves,
Awards,
Tracking,
Unlocks,
Submissions,
Notifications,
)
from CTFd.utils.decorators import authed_only, admins_only, rateli... | <filename>CTFd/api/v1/users.py
from flask import session, request, abort
from flask_restplus import Namespace, Resource
from CTFd.models import (
db,
Users,
Solves,
Awards,
Tracking,
Unlocks,
Submissions,
Notifications,
)
from CTFd.utils.decorators import authed_only, admins_only, rateli... | en | 0.254836 | # return {"success": True, "data": response.data} # return {"success": True, "data": data, "meta": {"count": count}} # return {"success": True, "data": response.data} | 2.268819 | 2 |
getting_started/pages.py | emilhe/dash-extensions-docs | 1 | 1693 | <filename>getting_started/pages.py
import dash_labs as dl
from dash_extensions.enrich import DashBlueprint, DashProxy, html, Output, Input
def page_name(i: int):
return f"page{i}"
def make_page(i: int):
page = DashBlueprint()
page.layout = html.Div([html.H2(f"Page {i}"), html.Button('Click me!', id='btn')... | <filename>getting_started/pages.py
import dash_labs as dl
from dash_extensions.enrich import DashBlueprint, DashProxy, html, Output, Input
def page_name(i: int):
return f"page{i}"
def make_page(i: int):
page = DashBlueprint()
page.layout = html.Div([html.H2(f"Page {i}"), html.Button('Click me!', id='btn')... | en | 0.872722 | # Register a few pages. # Setup main app layout. | 2.408804 | 2 |
zaqar/transport/wsgi/v2_0/homedoc.py | vkmc/zaqar-websocket | 1 | 1694 | # Copyright (c) 2013 Rackspace, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | # Copyright (c) 2013 Rackspace, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | en | 0.418938 | # Copyright (c) 2013 Rackspace, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy # of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w... | 1.653737 | 2 |
synapse/models/infotech.py | vertexproject/synapse | 216 | 1695 | import asyncio
import logging
import synapse.exc as s_exc
import synapse.lib.types as s_types
import synapse.lib.module as s_module
import synapse.lib.version as s_version
logger = logging.getLogger(__name__)
class Cpe23Str(s_types.Str):
'''
CPE 2.3 Formatted String
https://nvlpubs.nist.gov/nistpubs/Leg... | import asyncio
import logging
import synapse.exc as s_exc
import synapse.lib.types as s_types
import synapse.lib.module as s_module
import synapse.lib.version as s_version
logger = logging.getLogger(__name__)
class Cpe23Str(s_types.Str):
'''
CPE 2.3 Formatted String
https://nvlpubs.nist.gov/nistpubs/Leg... | en | 0.833637 | CPE 2.3 Formatted String https://nvlpubs.nist.gov/nistpubs/Legacy/IR/nistir7695.pdf (Section 6.2) cpe:2.3: part : vendor : product : version : update : edition : language : sw_edition : target_sw : target_hw : other * = "any" - = N/A Provides support for parsing a semantic version string... | 2.309888 | 2 |
test/test.py | bciar/ppp-web | 2 | 1696 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Unit tests."""
import os
import unittest
from copy import copy
from webui.app import create_app
class TestRoutes(unittest.TestCase):
"""Test routes."""
ignore_routes = ('/static/<path:filename>',)
ignore_end_patterns = ('>',)
def setUp(self):
... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Unit tests."""
import os
import unittest
from copy import copy
from webui.app import create_app
class TestRoutes(unittest.TestCase):
"""Test routes."""
ignore_routes = ('/static/<path:filename>',)
ignore_end_patterns = ('>',)
def setUp(self):
... | en | 0.559347 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- Unit tests. Test routes. Set up: Put Flask app in test mode. Validate route. Args: route (str): Route url pattern. Returns: bool: True if valid, else False. Smoke test routes to ensure no runtime errors.. | 2.548849 | 3 |
tests/sources/test_clang_format.py | Justin-Fisher/webots | 1,561 | 1697 | #!/usr/bin/env python
# Copyright 1996-2021 Cyberbotics Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | #!/usr/bin/env python
# Copyright 1996-2021 Cyberbotics Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | en | 0.825265 | #!/usr/bin/env python # Copyright 1996-2021 Cyberbotics Ltd. # # 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... | 2.246222 | 2 |
src/python/tests/core/system/shell_test.py | sanketsaurav/clusterfuzz | 1 | 1698 | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | en | 0.865758 | # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ... | 2.103526 | 2 |
Language Model/birnn/model.py | osamaqureshi/NLP-for-Urdu | 1 | 1699 | <filename>Language Model/birnn/model.py<gh_stars>1-10
import numpy as np
import tensorflow as tf
class Bidirectional(tf.keras.Model):
def __init__(self, units: int,
projection_units: int):
super(Bidirectional, self).__init__()
self.units = units
self.projection_units = pro... | <filename>Language Model/birnn/model.py<gh_stars>1-10
import numpy as np
import tensorflow as tf
class Bidirectional(tf.keras.Model):
def __init__(self, units: int,
projection_units: int):
super(Bidirectional, self).__init__()
self.units = units
self.projection_units = pro... | none | 1 | 2.344542 | 2 |