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 |
|---|---|---|---|---|---|---|---|---|---|---|
fetch_pbd_interaction/src/fetch_pbd_interaction/action.py | fetchrobotics/fetch_pbd | 16 | 6632951 | <filename>fetch_pbd_interaction/src/fetch_pbd_interaction/action.py
'''The in-program representation of a programmed action.'''
# ######################################################################
# Imports
# ######################################################################
# Core ROS imports come first.
imp... | <filename>fetch_pbd_interaction/src/fetch_pbd_interaction/action.py
'''The in-program representation of a programmed action.'''
# ######################################################################
# Imports
# ######################################################################
# Core ROS imports come first.
imp... | en | 0.721188 | The in-program representation of a programmed action. # ###################################################################### # Imports # ###################################################################### # Core ROS imports come first. # System builtins # ROS builtins # Local # ####################################... | 1.961164 | 2 |
src/chip8/lib/system.py | slastrina/pyChip8SDL | 0 | 6632952 | import os
import tkinter as tk
from tkinter import filedialog
from chip8 import rom_path
from chip8.lib.cpu import Cpu
from chip8.lib.display import Display
from chip8.lib.ram import Ram
class System:
flags = {
'draw': False,
'running': False
}
def __init__(self):
self.ram = Ram... | import os
import tkinter as tk
from tkinter import filedialog
from chip8 import rom_path
from chip8.lib.cpu import Cpu
from chip8.lib.display import Display
from chip8.lib.ram import Ram
class System:
flags = {
'draw': False,
'running': False
}
def __init__(self):
self.ram = Ram... | en | 0.741148 | # 0 # 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # A # B # C # D # E # F # Consider running in a dedicated thread | 2.860827 | 3 |
Demos/light_demo.py | jr-garcia/Engendro3D | 8 | 6632953 | <reponame>jr-garcia/Engendro3D
from math import sin
from random import randint, random
from cycgkit.cgtypes import vec3
from _base._BaseDemo import _Demo_Base, runDemo, tubeMODEL, logLevelsEnum
class Demo(_Demo_Base):
def __init__(self):
super(Demo, self).__init__()
self.texturesToLoad = [['e3dl... | from math import sin
from random import randint, random
from cycgkit.cgtypes import vec3
from _base._BaseDemo import _Demo_Base, runDemo, tubeMODEL, logLevelsEnum
class Demo(_Demo_Base):
def __init__(self):
super(Demo, self).__init__()
self.texturesToLoad = [['e3dlogo.png', 'logo'], ['./textures... | en | 0.680271 | # TODO: credit textures or replace them # .1 # self.sphere1.physicsBody.isDynamic = True # engine.models.loadPlane("planemodelback", 600, 300, 10) # IMPORTANT!: High number of segments (tesselation) is needed for large objects. See: # https://www.opengl.org/archives/resources/features/KilgardTechniques/oglpitfall/ # 2.... | 2.166114 | 2 |
Python/C1 - Intro/buggy_fixed.py | mrbinx/mrbinx_python | 0 | 6632954 | """
Task 1
@purpose This program requests for a positive integer, and prints out all primes less than the specified integer.
@author <NAME> 25461257
@since 20140803
@modified 20140806
@complexity O(n^2)
@precondition: The user inputs a positive integer
@postcondition: Primes less than the input are printed out
Changes... | """
Task 1
@purpose This program requests for a positive integer, and prints out all primes less than the specified integer.
@author <NAME> 25461257
@since 20140803
@modified 20140806
@complexity O(n^2)
@precondition: The user inputs a positive integer
@postcondition: Primes less than the input are printed out
Changes... | en | 0.806017 | Task 1 @purpose This program requests for a positive integer, and prints out all primes less than the specified integer. @author <NAME> 25461257 @since 20140803 @modified 20140806 @complexity O(n^2) @precondition: The user inputs a positive integer @postcondition: Primes less than the input are printed out Changes: Li... | 4.126724 | 4 |
workspace/module/python-2.7/LxMtx/mtxObjAbs.py | no7hings/Lynxi | 2 | 6632955 | <filename>workspace/module/python-2.7/LxMtx/mtxObjAbs.py
# coding:utf-8
from LxBasic import bscMethods
from LxData import datObjAbs
from LxGraphic import grhObjAbs
from . import mtxCfg
class Abs_MtxBasic(mtxCfg.MtxUtility):
pass
# ******************************************************************************... | <filename>workspace/module/python-2.7/LxMtx/mtxObjAbs.py
# coding:utf-8
from LxBasic import bscMethods
from LxData import datObjAbs
from LxGraphic import grhObjAbs
from . import mtxCfg
class Abs_MtxBasic(mtxCfg.MtxUtility):
pass
# ******************************************************************************... | el | 0.255187 | # coding:utf-8 # ******************************************************************************************************************** # # **************************************************************************************************************** # # property # port # ***********************************************... | 2.240978 | 2 |
lib/pyreadline/lineeditor/lineobj.py | dorcia592/mcplayeredit | 46 | 6632956 | <gh_stars>10-100
# -*- coding: utf-8 -*-
#*****************************************************************************
# Copyright (C) 2006 <NAME>. <<EMAIL>>
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#***********... | # -*- coding: utf-8 -*-
#*****************************************************************************
# Copyright (C) 2006 <NAME>. <<EMAIL>>
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#****************************... | en | 0.354081 | # -*- coding: utf-8 -*- #***************************************************************************** # Copyright (C) 2006 <NAME>. <<EMAIL>> # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this software. #**********************************... | 2.459875 | 2 |
config.py | golnazads/export_service | 4 | 6632957 | <reponame>golnazads/export_service
# must be here for adsmutils to override it using env vars
# but if left empty (resolving to False) it won't be used
SERVICE_TOKEN = None
# configuration for accessing solr db
# these values can be overwritten by local_config values
# maximum number of records that can be fetched by... | # must be here for adsmutils to override it using env vars
# but if left empty (resolving to False) it won't be used
SERVICE_TOKEN = None
# configuration for accessing solr db
# these values can be overwritten by local_config values
# maximum number of records that can be fetched by bigquery is for now 2000
# this can... | en | 0.869372 | # must be here for adsmutils to override it using env vars # but if left empty (resolving to False) it won't be used # configuration for accessing solr db # these values can be overwritten by local_config values # maximum number of records that can be fetched by bigquery is for now 2000 # this can be overwritten to bec... | 1.784021 | 2 |
src/utils.py | anoir2/amazon-braket-community-detection | 5 | 6632958 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import os
import shutil
from urllib.request import urlopen
from zipfile import ZipFile
from io import BytesIO
def download_graphs(graph_url, data_dir = "./graph_data"):
"""
Download graph .zip files from web ... | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import os
import shutil
from urllib.request import urlopen
from zipfile import ZipFile
from io import BytesIO
def download_graphs(graph_url, data_dir = "./graph_data"):
"""
Download graph .zip files from web ... | en | 0.744812 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 Download graph .zip files from web URL :param graph_url: dict, with a format of {'graph_name': 'url'} :param data_dir: str, the directory path to store graph data Clean graph data by removing header lines ... | 3.34155 | 3 |
src/leetcodepython/tree/construct_string_binary_tree_606.py | zhangyu345293721/leetcode | 90 | 6632959 | <filename>src/leetcodepython/tree/construct_string_binary_tree_606.py
'''
/**
* This is the solution of No. 606 problem in the book <i>Coding Interviews: Questions, Analysis & Solutions</i>,
* the website of the problem is as follow:
* https://leetcode-cn.com/problems/construct-string-from-binary-tree
* The descrip... | <filename>src/leetcodepython/tree/construct_string_binary_tree_606.py
'''
/**
* This is the solution of No. 606 problem in the book <i>Coding Interviews: Questions, Analysis & Solutions</i>,
* the website of the problem is as follow:
* https://leetcode-cn.com/problems/construct-string-from-binary-tree
* The descrip... | zh | 0.587825 | /** * This is the solution of No. 606 problem in the book <i>Coding Interviews: Questions, Analysis & Solutions</i>, * the website of the problem is as follow: * https://leetcode-cn.com/problems/construct-string-from-binary-tree * The description of problem is as follow: * =========================================... | 3.252639 | 3 |
coffin/contrib/loader.py | kazmiruk/coffin | 1 | 6632960 | # -*- coding: utf-8 -*-
"""
A Django template loader wrapper for Coffin that intercepts
requests for "*.jinja" templates, rendering them with Coffin
instead of Django templates.
Usage:
TEMPLATE_LOADERS = (
'coffin.contrib.loader.AppLoader',
'coffin.contrib.loader.FileSystemLoader',
)
"""
from os.path import... | # -*- coding: utf-8 -*-
"""
A Django template loader wrapper for Coffin that intercepts
requests for "*.jinja" templates, rendering them with Coffin
instead of Django templates.
Usage:
TEMPLATE_LOADERS = (
'coffin.contrib.loader.AppLoader',
'coffin.contrib.loader.FileSystemLoader',
)
"""
from os.path import... | en | 0.328094 | # -*- coding: utf-8 -*- A Django template loader wrapper for Coffin that intercepts requests for "*.jinja" templates, rendering them with Coffin instead of Django templates. Usage: TEMPLATE_LOADERS = ( 'coffin.contrib.loader.AppLoader', 'coffin.contrib.loader.FileSystemLoader', ) | 2.483237 | 2 |
src/ai.py | linhusp/gomoku-alphabeta | 4 | 6632961 | <gh_stars>1-10
import piece
import numpy as np
from eval_fn import evaluation_state
def get_best_move(state, depth, is_max_state):
values = state.values
best_value = is_max_state and -9999 or 9999
best_move = (-1, -1)
pieces = len(values[values != piece.EMPTY])
if pieces == 0:
return firs... | import piece
import numpy as np
from eval_fn import evaluation_state
def get_best_move(state, depth, is_max_state):
values = state.values
best_value = is_max_state and -9999 or 9999
best_move = (-1, -1)
pieces = len(values[values != piece.EMPTY])
if pieces == 0:
return first_move(state)
... | my | 0.060438 | # print(best_move, best_value) | 3.129751 | 3 |
spec/behavior_pyspec_localization.py | jyotijaya/pyspec | 1 | 6632962 | <reponame>jyotijaya/pyspec
# -*- coding: utf-8 -*-
import sys, os
parent_path = os.path.split(os.path.abspath("."))[0]
if parent_path not in sys.path:
sys.path.insert(0, parent_path)
from pyspec import *
from pyspec.mockobject import *
import pyspec.framework
import pyspec.embedded.setting as setting
class Beha... | # -*- coding: utf-8 -*-
import sys, os
parent_path = os.path.split(os.path.abspath("."))[0]
if parent_path not in sys.path:
sys.path.insert(0, parent_path)
from pyspec import *
from pyspec.mockobject import *
import pyspec.framework
import pyspec.embedded.setting as setting
class Behavior_Setting_for_Localizati... | en | 0.795189 | # -*- coding: utf-8 -*- # pyspec can't accept tlhIngan Hol! | 2.169847 | 2 |
heekscnc/nc/hpgl3d_read.py | JohnyEngine/CNC | 0 | 6632963 | <filename>heekscnc/nc/hpgl3d_read.py<gh_stars>0
import num_reader
import sys
import math
class Parser(num_reader.NumReader):
def __init__(self, writer):
num_reader.NumReader.__init__(self, writer)
self.x = 0
self.y = 0
self.z = 10000
self.f = 0
self.units_to_mm = 0.... | <filename>heekscnc/nc/hpgl3d_read.py<gh_stars>0
import num_reader
import sys
import math
class Parser(num_reader.NumReader):
def __init__(self, writer):
num_reader.NumReader.__init__(self, writer)
self.x = 0
self.y = 0
self.z = 10000
self.f = 0
self.units_to_mm = 0.... | none | 1 | 2.953043 | 3 | |
mdpo/io.py | dingyifei/mdpo | 8 | 6632964 | """mdpo I/O utilities."""
import glob
import hashlib
import os
import re
def filter_paths(filepaths, ignore_paths=[]):
"""Filters a list of paths removing those defined in other list of paths.
The paths to filter can be defined in the list of paths to ignore in
several forms:
- The same string.
... | """mdpo I/O utilities."""
import glob
import hashlib
import os
import re
def filter_paths(filepaths, ignore_paths=[]):
"""Filters a list of paths removing those defined in other list of paths.
The paths to filter can be defined in the list of paths to ignore in
several forms:
- The same string.
... | en | 0.814168 | mdpo I/O utilities. Filters a list of paths removing those defined in other list of paths. The paths to filter can be defined in the list of paths to ignore in several forms: - The same string. - Only the file name. - Only their direct directory name. - Their direct directory full path. A... | 4.001352 | 4 |
pytorch_widedeep/models/tabular/transformers/tab_perceiver.py | TangleSpace/pytorch-widedeep | 0 | 6632965 | import torch
import einops
from torch import nn
from pytorch_widedeep.wdtypes import * # noqa: F403
from pytorch_widedeep.models.tabular.mlp._layers import MLP
from pytorch_widedeep.models.tabular._base_tabular_model import (
BaseTabularModelWithAttention,
)
from pytorch_widedeep.models.tabular.transformers._enco... | import torch
import einops
from torch import nn
from pytorch_widedeep.wdtypes import * # noqa: F403
from pytorch_widedeep.models.tabular.mlp._layers import MLP
from pytorch_widedeep.models.tabular._base_tabular_model import (
BaseTabularModelWithAttention,
)
from pytorch_widedeep.models.tabular.transformers._enco... | en | 0.718035 | # noqa: F403 Defines an adaptation of a `Perceiver model <https://arxiv.org/abs/2103.03206>`_ that can be used as the ``deeptabular`` component of a Wide & Deep model or independently by itself. Parameters ---------- column_idx: Dict Dict containing the index of the columns that will be... | 2.150007 | 2 |
mmdet/models/dense_heads/rpn_test_mixin.py | morkovka1337/mmdetection | 58 | 6632966 | # Copyright (C) 2018-2021 OpenMMLab
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2020-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
import sys
from mmdet.core import merge_aug_proposals
from mmdet.integration.nncf.utils import no_nncf_trace
if sys.version_info >= (3, 7):
from mmdet.ut... | # Copyright (C) 2018-2021 OpenMMLab
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2020-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
import sys
from mmdet.core import merge_aug_proposals
from mmdet.integration.nncf.utils import no_nncf_trace
if sys.version_info >= (3, 7):
from mmdet.ut... | en | 0.577913 | # Copyright (C) 2018-2021 OpenMMLab # SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2020-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # Test methods of RPN. Test without augmentation. Args: x (tuple[Tensor]): Features from the upstream network, each is a 4D-t... | 1.997244 | 2 |
instagram/migrations/0001_initial.py | Frankline-Kiplangat/instagram-app | 1 | 6632967 | <gh_stars>1-10
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2020-08-12 23:26
from __future__ import unicode_literals
import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import pyuploadcare.dj.models
class Migration(migrations.Migration):... | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2020-08-12 23:26
from __future__ import unicode_literals
import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import pyuploadcare.dj.models
class Migration(migrations.Migration):
initial =... | en | 0.78524 | # -*- coding: utf-8 -*- # Generated by Django 1.11 on 2020-08-12 23:26 | 1.785692 | 2 |
flexneuart/featextr_server/base.py | gitter-badger/FlexNeuART | 101 | 6632968 | #
# Copyright 2014+ Carnegie Mellon University
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | #
# Copyright 2014+ Carnegie Mellon University
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | en | 0.845401 | # # Copyright 2014+ Carnegie Mellon University # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag... | 1.769249 | 2 |
app/app4.py | lalopark/1DS_HW2 | 0 | 6632969 | # app4.py
import numpy as np
import pandas as pd
import altair as alt
import plotly.express as px
import plotly.graph_objs as go
import pickle as pkle
import os.path
import streamlit as st
def app():
st.title('Writeup')
st.write('We created several different visualizations of the data set from both a mac... | # app4.py
import numpy as np
import pandas as pd
import altair as alt
import plotly.express as px
import plotly.graph_objs as go
import pickle as pkle
import os.path
import streamlit as st
def app():
st.title('Writeup')
st.write('We created several different visualizations of the data set from both a mac... | en | 0.947025 | # app4.py # of hours formally trained as a data scientist apart from general\ | 2.697246 | 3 |
robosuite/environments/panda.py | sumaaail/vices | 1 | 6632970 | from collections import OrderedDict
import numpy as np
import robosuite.utils.transform_utils as T
from robosuite.environments import MujocoEnv
from robosuite.models.grippers import gripper_factory
from robosuite.models.robots import Panda
from robosuite.controllers.arm_controller import *
from collections import de... | from collections import OrderedDict
import numpy as np
import robosuite.utils.transform_utils as T
from robosuite.environments import MujocoEnv
from robosuite.models.grippers import gripper_factory
from robosuite.models.robots import Panda
from robosuite.controllers.arm_controller import *
from collections import de... | en | 0.753621 | Initializes a Panda robot environment. # TODO # TODO - currently not included in the config file (should be a function) Args: controller_config_file (str): filepath to the corresponding controller config file that contains the associated controller parameters controller (str): C... | 2.336223 | 2 |
src/sqlizer/conversionstatus.py | sqlizer-io/sqlizer-client-py | 11 | 6632971 |
class ConversionStatus:
NotCreated = None
New = 'New'
Uploaded = 'Uploaded'
Queued = 'Queued'
Analyzing = 'Analyzing'
Processing = 'Processing'
Complete = 'Complete'
Failed = 'Failed'
SubscriptionRequired = 'SubscriptionRequired'
PaymentRequired = 'PaymentRequired' |
class ConversionStatus:
NotCreated = None
New = 'New'
Uploaded = 'Uploaded'
Queued = 'Queued'
Analyzing = 'Analyzing'
Processing = 'Processing'
Complete = 'Complete'
Failed = 'Failed'
SubscriptionRequired = 'SubscriptionRequired'
PaymentRequired = 'PaymentRequired' | none | 1 | 1.434139 | 1 | |
s3/replication/common/src/s3replicationcommon/s3_put_object.py | rajkumarpatel2602/cortx-multisite | 1 | 6632972 | <gh_stars>1-10
#
# Copyright (c) 2021 Seagate Technology LLC and/or its Affiliates
#
# 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... | #
# Copyright (c) 2021 Seagate Technology LLC and/or its Affiliates
#
# 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... | en | 0.792629 | # # Copyright (c) 2021 Seagate Technology LLC and/or its Affiliates # # 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... | 1.645004 | 2 |
2DTFIM_2DRNN/run_2dTFIM.py | MatteoMartinelli97/RNNWavefunctions | 47 | 6632973 | <reponame>MatteoMartinelli97/RNNWavefunctions
from Training2DRNN_2DTFIM import run_2DTFIM
#numsteps = number of training iterations
#systemsize_x = the size of the x-dimension of the square lattice
#systemsize_x = the size of the y-dimension of the square lattice
#Bx = transverse magnetic field
#numsamples = number of... | from Training2DRNN_2DTFIM import run_2DTFIM
#numsteps = number of training iterations
#systemsize_x = the size of the x-dimension of the square lattice
#systemsize_x = the size of the y-dimension of the square lattice
#Bx = transverse magnetic field
#numsamples = number of samples used for training
#num_units = number... | en | 0.79471 | #numsteps = number of training iterations #systemsize_x = the size of the x-dimension of the square lattice #systemsize_x = the size of the y-dimension of the square lattice #Bx = transverse magnetic field #numsamples = number of samples used for training #num_units = number of memory units of the hidden state of the R... | 2.958517 | 3 |
books_scrapy/loaders.py | hdtls/books-scrapy | 0 | 6632974 | from books_scrapy.items import (
Manga,
Author,
MangaArea,
MangaCategory,
MangaChapter,
PHAsset,
)
from itemloaders.utils import arg_to_iter
from itemloaders.processors import Compose, Identity, MapCompose, TakeFirst
from scrapy.loader import ItemLoader
def splitting(value):
if not value:
... | from books_scrapy.items import (
Manga,
Author,
MangaArea,
MangaCategory,
MangaChapter,
PHAsset,
)
from itemloaders.utils import arg_to_iter
from itemloaders.processors import Compose, Identity, MapCompose, TakeFirst
from scrapy.loader import ItemLoader
def splitting(value):
if not value:
... | none | 1 | 2.573682 | 3 | |
Mini Projects/QuadraticSolver/QuadraticSolver.py | Snowystar122/Python-Projects | 0 | 6632975 | import math
# Generates real and complex solutions for a quadratic polynomial
def solution(var_a, var_b, to_root):
if to_root > 0:
sol_1 = (-1 * var_b + math.sqrt(to_root)) / (2 * var_a)
sol_2 = (-1 * var_b - math.sqrt(to_root)) / (2 * var_a)
return f"The solutions are:\n{sol_1}\n{sol_2}"
... | import math
# Generates real and complex solutions for a quadratic polynomial
def solution(var_a, var_b, to_root):
if to_root > 0:
sol_1 = (-1 * var_b + math.sqrt(to_root)) / (2 * var_a)
sol_2 = (-1 * var_b - math.sqrt(to_root)) / (2 * var_a)
return f"The solutions are:\n{sol_1}\n{sol_2}"
... | en | 0.81215 | # Generates real and complex solutions for a quadratic polynomial # Coefficients of the polynomial | 4.10967 | 4 |
arguments/user_init.py | JedBurke/Rename-py | 0 | 6632976 | import argparse
import os
from helpers.user import UserHelpers
class InitializeUserConfig(argparse.Action):
"""docstring for InitializeUserConfig"""
def __init__(self, option_strings, dest, nargs=None, **kwargs):
if nargs is not None:
raise ValueError("nargs not allowed")
super(Ini... | import argparse
import os
from helpers.user import UserHelpers
class InitializeUserConfig(argparse.Action):
"""docstring for InitializeUserConfig"""
def __init__(self, option_strings, dest, nargs=None, **kwargs):
if nargs is not None:
raise ValueError("nargs not allowed")
super(Ini... | en | 0.387629 | docstring for InitializeUserConfig | 2.892826 | 3 |
tests/test_datastore.py | pyeventsourcing/eventsourcing-sqlalchemy | 13 | 6632977 | <gh_stars>10-100
# -*- coding: utf-8 -*-
from unittest import TestCase
from sqlalchemy.future import create_engine
from sqlalchemy.orm import sessionmaker
from eventsourcing_sqlalchemy.datastore import SQLAlchemyDatastore
class TestDatastore(TestCase):
def test_should_be_created_with_url(self) -> None:
... | # -*- coding: utf-8 -*-
from unittest import TestCase
from sqlalchemy.future import create_engine
from sqlalchemy.orm import sessionmaker
from eventsourcing_sqlalchemy.datastore import SQLAlchemyDatastore
class TestDatastore(TestCase):
def test_should_be_created_with_url(self) -> None:
datastore = SQLAl... | en | 0.769321 | # -*- coding: utf-8 -*- | 2.624546 | 3 |
tests/test_pedpedspace_interaction.py | Femme-js/PySocialForceJ | 42 | 6632978 | <filename>tests/test_pedpedspace_interaction.py
import numpy as np
import pysocialforce as psf
def test_r_aB():
state = np.array([[0.0, 0.0, 0.0, 0.0, 0.0, 1.0], [1.0, 0.0, 0.0, 0.0, 1.0, 1.0],])
obstacles = [np.array([[0.0, 100.0], [0.0, 0.5]])]
r_aB = psf.PedSpacePotential(obstacles).r_aB(state)
as... | <filename>tests/test_pedpedspace_interaction.py
import numpy as np
import pysocialforce as psf
def test_r_aB():
state = np.array([[0.0, 0.0, 0.0, 0.0, 0.0, 1.0], [1.0, 0.0, 0.0, 0.0, 1.0, 1.0],])
obstacles = [np.array([[0.0, 100.0], [0.0, 0.5]])]
r_aB = psf.PedSpacePotential(obstacles).r_aB(state)
as... | none | 1 | 2.397244 | 2 | |
third_party/spider/baselines/seq2seq_attention_copy/seq2seq/models/attention_seq2seq.py | chenyangh/tensor2struct-public | 69 | 6632979 | # 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 writing,... | # 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 writing,... | en | 0.812775 | # 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 writing,... | 2.079861 | 2 |
Entities/RBAC.py | srinibasmisra97/OAuth-Authorization-Server | 0 | 6632980 | from Utils.DBOperations import Read, Update
from Entities.Clients import Clients
import json, uuid
db_obj = None
COL_NAME = 'applications'
def db_init():
"""
This function checks the mongodb connections object.
:return: Mongodb connections object.
"""
global db_obj
if db_obj is None:
... | from Utils.DBOperations import Read, Update
from Entities.Clients import Clients
import json, uuid
db_obj = None
COL_NAME = 'applications'
def db_init():
"""
This function checks the mongodb connections object.
:return: Mongodb connections object.
"""
global db_obj
if db_obj is None:
... | en | 0.729402 | This function checks the mongodb connections object. :return: Mongodb connections object. Init method for a permission. :param name: Name of the permission. :param value: Permission string. Should be unique. This function returns a permission document. :param application: Application. ... | 2.942219 | 3 |
mmdet/models/backbones/gate.py | vinnibuh/mmdetection | 0 | 6632981 | <reponame>vinnibuh/mmdetection
import torch
import torch.nn as nn
from .gumbel import GumbleSoftmax
class GateModule(nn.Module):
def __init__(self, in_ch, act='relu', kernel_size=None, doubleGate=False, dwLA=False):
super(GateModule, self).__init__()
self.doubleGate, self.dwLA = doubleGate, dwLA
... | import torch
import torch.nn as nn
from .gumbel import GumbleSoftmax
class GateModule(nn.Module):
def __init__(self, in_ch, act='relu', kernel_size=None, doubleGate=False, dwLA=False):
super(GateModule, self).__init__()
self.doubleGate, self.dwLA = doubleGate, dwLA
self.inp_gs = GumbleSoft... | none | 1 | 2.552623 | 3 | |
gssClients/gssPythonClients/delete_gss.py | SemWES/client_libs | 0 | 6632982 | <reponame>SemWES/client_libs
#!/bin/env python
# Copyright STIFTELSEN SINTEF 2016
import suds
import urllib2
import sys
if len(sys.argv) < 3:
print ("Usage:")
print ("\t %s gss-url token" % sys.argv[0])
exit()
# get url:
url = sys.argv[1]
sessionToken = sys.argv[2]
wsdl_url = "https://api.caxman.eu/sin... | #!/bin/env python
# Copyright STIFTELSEN SINTEF 2016
import suds
import urllib2
import sys
if len(sys.argv) < 3:
print ("Usage:")
print ("\t %s gss-url token" % sys.argv[0])
exit()
# get url:
url = sys.argv[1]
sessionToken = sys.argv[2]
wsdl_url = "https://api.caxman.eu/sintef/infrastructure/gss-0.1/Fi... | en | 0.426234 | #!/bin/env python # Copyright STIFTELSEN SINTEF 2016 # get url: | 2.507796 | 3 |
html_tag_count.py | daoudclarke/tinysearch-spark | 207 | 6632983 | <reponame>daoudclarke/tinysearch-spark
import re
from collections import Counter
from sparkcc import CCSparkJob
class TagCountJob(CCSparkJob):
""" Count HTML tag names in Common Crawl WARC files"""
name = "TagCount"
# match HTML tags (element names) on binary HTML data
html_tag_pattern = re.compil... | import re
from collections import Counter
from sparkcc import CCSparkJob
class TagCountJob(CCSparkJob):
""" Count HTML tag names in Common Crawl WARC files"""
name = "TagCount"
# match HTML tags (element names) on binary HTML data
html_tag_pattern = re.compile(b'<([a-z0-9]+)')
def process_rec... | en | 0.423981 | Count HTML tag names in Common Crawl WARC files # match HTML tags (element names) on binary HTML data # skip over WARC request or metadata records # skip non-HTML or unknown content types | 2.868656 | 3 |
lib/python2.7/site-packages/scipy/misc/tests/test_common.py | wfehrnstrom/harmonize | 18 | 6632984 | from __future__ import division, print_function, absolute_import
from numpy.testing import assert_equal, assert_
from scipy.misc import pade, logsumexp, face, ascent
from scipy.special import logsumexp as sc_logsumexp
from scipy.interpolate import pade as i_pade
def test_logsumexp():
# make sure logsumexp can b... | from __future__ import division, print_function, absolute_import
from numpy.testing import assert_equal, assert_
from scipy.misc import pade, logsumexp, face, ascent
from scipy.special import logsumexp as sc_logsumexp
from scipy.interpolate import pade as i_pade
def test_logsumexp():
# make sure logsumexp can b... | en | 0.641693 | # make sure logsumexp can be imported from either scipy.misc or # scipy.special | 2.258261 | 2 |
demo/gesture_inference.py | jiangtaoo2333/StaticGestureRecognition | 0 | 6632985 | <gh_stars>0
import argparse
import os
import os.path as osp
import sys
import time
import mmcv
import numpy as np
import torch
from mmcv import Config
import torch.nn as nn
import cv2
dirpath = osp.dirname(osp.dirname(osp.abspath(__file__))).replace('\\','/')
sys.path.append(dirpath)
import timm
def get_args():
... | import argparse
import os
import os.path as osp
import sys
import time
import mmcv
import numpy as np
import torch
from mmcv import Config
import torch.nn as nn
import cv2
dirpath = osp.dirname(osp.dirname(osp.abspath(__file__))).replace('\\','/')
sys.path.append(dirpath)
import timm
def get_args():
parser = ar... | en | 0.292993 | image is numpy h w box is [x,y,x,y] # 输入图片预处理 # 1 128 128 # 1 128 128 # 1 1 128 128 | 2.095242 | 2 |
Exercicios/ex059.py | jlsmirandela/Curso_Python | 0 | 6632986 | pv = int(input('Insira o primeiro valor - '))
sv = int(input('Insira o segundo valor - '))
op = 0
while op != 5:
print('''[ 1 ] Somar
[ 2 ] Multiplicar
[ 3 ] Maior
[ 4 ] Novos números
[ 5 ] Sair''')
op = int(input('>>>>>>>> Qual a sua opção? - '))
while op not in range(0, 6):
op = int(input('Opção... | pv = int(input('Insira o primeiro valor - '))
sv = int(input('Insira o segundo valor - '))
op = 0
while op != 5:
print('''[ 1 ] Somar
[ 2 ] Multiplicar
[ 3 ] Maior
[ 4 ] Novos números
[ 5 ] Sair''')
op = int(input('>>>>>>>> Qual a sua opção? - '))
while op not in range(0, 6):
op = int(input('Opção... | pt | 0.27341 | [ 1 ] Somar [ 2 ] Multiplicar [ 3 ] Maior [ 4 ] Novos números [ 5 ] Sair | 3.909227 | 4 |
torchsso/__init__.py | fmahdisoltani/multimodal_madam | 0 | 6632987 | from torchsso import optim # NOQA
from torchsso import autograd # NOQA
from torchsso import utils # NOQA
from torchsso.curv.curvature import Curvature, DiagCurvature, KronCurvature # NOQA
from torchsso.curv.cov.linear import CovLinear, DiagCovLinear, KronCovLinear, DiagGMMLinear # NOQA
from torchsso.curv.cov.conv... | from torchsso import optim # NOQA
from torchsso import autograd # NOQA
from torchsso import utils # NOQA
from torchsso.curv.curvature import Curvature, DiagCurvature, KronCurvature # NOQA
from torchsso.curv.cov.linear import CovLinear, DiagCovLinear, KronCovLinear, DiagGMMLinear # NOQA
from torchsso.curv.cov.conv... | ur | 0.237172 | # NOQA # NOQA # NOQA # NOQA # NOQA # NOQA # NOQA # NOQA # NOQA # NOQA # NOQA # NOQA # NOQA # NOQA # NOQA | 1.515229 | 2 |
mintamazontagger/category.py | glassdimly/mint-amazon-tagger | 0 | 6632988 |
# The default Mint category.
DEFAULT_MINT_CATEGORY = 'Shopping'
# The default return category.
DEFAULT_MINT_RETURN_CATEGORY = 'Returned Purchase'
# A category mapping of Amazon Order History "Categories" into Mint
# "Categories".
AMAZON_TO_MINT_CATEGORY = {
'Accessory': DEFAULT_MINT_CATEGORY,
'Apparel': 'Clo... |
# The default Mint category.
DEFAULT_MINT_CATEGORY = 'Shopping'
# The default return category.
DEFAULT_MINT_RETURN_CATEGORY = 'Returned Purchase'
# A category mapping of Amazon Order History "Categories" into Mint
# "Categories".
AMAZON_TO_MINT_CATEGORY = {
'Accessory': DEFAULT_MINT_CATEGORY,
'Apparel': 'Clo... | en | 0.491832 | # The default Mint category. # The default return category. # A category mapping of Amazon Order History "Categories" into Mint # "Categories". # Pulled early 2018. | 2.003522 | 2 |
ceph_deploy/tests/test_install.py | weisongf/ceph-deploy | 353 | 6632989 | <gh_stars>100-1000
from mock import Mock
from ceph_deploy import install
class TestSanitizeArgs(object):
def setup(self):
self.args = Mock()
# set the default behavior we set in cli.py
self.args.default_release = False
self.args.stable = None
def test_args_release_not_specif... | from mock import Mock
from ceph_deploy import install
class TestSanitizeArgs(object):
def setup(self):
self.args = Mock()
# set the default behavior we set in cli.py
self.args.default_release = False
self.args.stable = None
def test_args_release_not_specified(self):
... | en | 0.778931 | # set the default behavior we set in cli.py # XXX # we should get `args.release` to be the latest release # but we don't want to be updating this test every single # time there is a new default value, and we can't programatically # change that. Future improvement: make the default release a # variable in `ceph_deploy/_... | 2.378711 | 2 |
hawc_hal/healpix_handling/flat_sky_to_healpix.py | igherzog/hawc_hal | 7 | 6632990 | <reponame>igherzog/hawc_hal<filename>hawc_hal/healpix_handling/flat_sky_to_healpix.py<gh_stars>1-10
from builtins import object
import healpy as hp
import numpy as np
import six
from scipy.ndimage import map_coordinates
from astropy.coordinates import Galactic, ICRS
from astropy import units as u
from astropy.coordin... | from builtins import object
import healpy as hp
import numpy as np
import six
from scipy.ndimage import map_coordinates
from astropy.coordinates import Galactic, ICRS
from astropy import units as u
from astropy.coordinates import UnitSphericalRepresentation
from astropy.wcs.utils import wcs_to_celestial_frame
from .... | en | 0.710189 | # pragma: no cover A class to perform transformation from a flat sky projection to Healpix optimized to be used for the same transformation over and over again. The constructor will pre-compute all needed quantities for the transformation, and the __call__ method just applies the transformation. This avoid... | 2.301408 | 2 |
app/dnt_main.py | fatihy101/detect-and-track | 0 | 6632991 | <filename>app/dnt_main.py
from pyimagesearch.centroidtracker import CentroidTracker
from pyimagesearch.trackableobject import TrackableObject
from imutils.video import FPS
import numpy as np
import imutils
import dlib
import tensorflow.compat.v1 as tf
from object_detection.utils import label_map_util
from object_detect... | <filename>app/dnt_main.py
from pyimagesearch.centroidtracker import CentroidTracker
from pyimagesearch.trackableobject import TrackableObject
from imutils.video import FPS
import numpy as np
import imutils
import dlib
import tensorflow.compat.v1 as tf
from object_detection.utils import label_map_util
from object_detect... | en | 0.660435 | # Operation # Less data we have, faster we are. # For eliminating the false positives. # cv2.line(self.frame, (W // 2, 0), (W // 2, H), (0, 255, 255), 2) # if the direction is negative (indicating the object # is moving up) AND the centroid is above the center # line, count the object # End of the loop # # Clear output... | 2.043574 | 2 |
core/thirdparty/ovf/python/test/simple.py | ddkn/spirit | 92 | 6632992 | import os
import sys
ovf_py_dir = os.path.abspath(os.path.join(os.path.dirname( __file__ ), ".."))
sys.path.insert(0, ovf_py_dir)
from ovf import ovf
import numpy as np
import unittest
##########
class TestState(unittest.TestCase):
def test_nonexistent(self):
print("----- ovf test nonexistent")
... | import os
import sys
ovf_py_dir = os.path.abspath(os.path.join(os.path.dirname( __file__ ), ".."))
sys.path.insert(0, ovf_py_dir)
from ovf import ovf
import numpy as np
import unittest
##########
class TestState(unittest.TestCase):
def test_nonexistent(self):
print("----- ovf test nonexistent")
... | de | 0.934246 | ########## ######### | 2.630263 | 3 |
test/IECoreHoudini/ToHoudiniPolygonsConverter.py | bradleyhenke/cortex | 2 | 6632993 | ##########################################################################
#
# Copyright (c) 2010-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redis... | ##########################################################################
#
# Copyright (c) 2010-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redis... | en | 0.645139 | ########################################################################## # # Copyright (c) 2010-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redis... | 0.774036 | 1 |
examples/bar_chart_examples.py | ahlusar1989/vincent | 1,052 | 6632994 | # -*- coding: utf-8 -*-
"""
Vincent Bar Chart Example
"""
#Build a Bar Chart from scratch
from vincent import *
import pandas as pd
farm_1 = {'apples': 10, 'berries': 32, 'squash': 21, 'melons': 13, 'corn': 18}
farm_2 = {'apples': 15, 'berries': 43, 'squash': 17, 'melons': 10, 'corn': 22}
farm_3 = {'apples': 6, 'b... | # -*- coding: utf-8 -*-
"""
Vincent Bar Chart Example
"""
#Build a Bar Chart from scratch
from vincent import *
import pandas as pd
farm_1 = {'apples': 10, 'berries': 32, 'squash': 21, 'melons': 13, 'corn': 18}
farm_2 = {'apples': 15, 'berries': 43, 'squash': 17, 'melons': 10, 'corn': 22}
farm_3 = {'apples': 6, 'b... | en | 0.728599 | # -*- coding: utf-8 -*- Vincent Bar Chart Example #Build a Bar Chart from scratch #Marks #Using a Vincent KeyedList here #Convenience methods #Fruit #From dict #From dict of iterables #Finally, a boring bar chart from a list | 3.407511 | 3 |
src/charma/persons/actors/handler.py | mononobi/charma-server | 1 | 6632995 | # -*- coding: utf-8 -*-
"""
actors handler module.
"""
import charma.persons.actors.services as actor_services
from charma.persons.decorators import person_handler
from charma.persons.enumerations import PersonTypeEnum
from charma.persons.handler import AbstractPersonHandler
@person_handler()
class ActorHandler(Abs... | # -*- coding: utf-8 -*-
"""
actors handler module.
"""
import charma.persons.actors.services as actor_services
from charma.persons.decorators import person_handler
from charma.persons.enumerations import PersonTypeEnum
from charma.persons.handler import AbstractPersonHandler
@person_handler()
class ActorHandler(Abs... | en | 0.656762 | # -*- coding: utf-8 -*- actors handler module. actor handler class. creates an actor with given inputs. :param uuid.UUID id: person id. | 2.757755 | 3 |
holecmm.py | joelmeyerson/hole-cmm | 0 | 6632996 | #------------------------------------------------- holecmm.py --------------------------------------------
#
# Python script to convert the output of HOLE to a CMM file that can be visualized in Chimera or ChimeraX.
#
# Usage:
# python holecmm.py
#
# Show inputs:
# python holecmm.py -h
#
# Parameter... | #------------------------------------------------- holecmm.py --------------------------------------------
#
# Python script to convert the output of HOLE to a CMM file that can be visualized in Chimera or ChimeraX.
#
# Usage:
# python holecmm.py
#
# Show inputs:
# python holecmm.py -h
#
# Parameter... | en | 0.42817 | #------------------------------------------------- holecmm.py -------------------------------------------- # # Python script to convert the output of HOLE to a CMM file that can be visualized in Chimera or ChimeraX. # # Usage: # python holecmm.py # # Show inputs: # python holecmm.py -h # # Parameters: # ... | 2.459626 | 2 |
SBS.py | hduliufan/work | 0 | 6632997 | #序列反向选择算法sbs
from sklearn.base import clone
#itertools迭代器产生
from itertools import combinations
from sklearn.metrics import accuracy_score
import numpy as np
from sklearn.cross_validation import train_test_split
class SBS(object):
'''
estimator 是采用的方法分类后的模型
'''
def __init__(self,estimator, k_feature, s... | #序列反向选择算法sbs
from sklearn.base import clone
#itertools迭代器产生
from itertools import combinations
from sklearn.metrics import accuracy_score
import numpy as np
from sklearn.cross_validation import train_test_split
class SBS(object):
'''
estimator 是采用的方法分类后的模型
'''
def __init__(self,estimator, k_feature, s... | zh | 0.971369 | #序列反向选择算法sbs #itertools迭代器产生 estimator 是采用的方法分类后的模型 #indices 目录 元组不能改变 #类内全局变量 #子集subset #数组的一个元素 #子集存储 #argmax返回值是最大值的indices #返回的是最优的子集即score最大的子集目录即列向量标号 #存储的是score最大的子集 #返回的是满足阈值的最佳score #返回最佳的特征列 #实际是调用accuracy_score 进行正确率 | 2.654305 | 3 |
rama/config.py | tadfisher/rama | 2 | 6632998 | import layout
import view
defaults = {
'layouts': [layout.TileLayout()],
'views': ['main']
}
| import layout
import view
defaults = {
'layouts': [layout.TileLayout()],
'views': ['main']
}
| none | 1 | 1.324789 | 1 | |
scrapeops_python_logger/utils/error_handling.py | ScrapeOps/scrapeops-python-logger | 0 | 6632999 | <filename>scrapeops_python_logger/utils/error_handling.py
import functools
from scrapeops_python_logger.exceptions import ScrapeOpsAPIResponseError
def exception_handler(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
try:
return func(*args, **kwargs)
except ScrapeOpsAP... | <filename>scrapeops_python_logger/utils/error_handling.py
import functools
from scrapeops_python_logger.exceptions import ScrapeOpsAPIResponseError
def exception_handler(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
try:
return func(*args, **kwargs)
except ScrapeOpsAP... | none | 1 | 2.59916 | 3 | |
gdsfactory/components/pack_doe.py | thomasdorch/gdsfactory | 0 | 6633000 | import itertools as it
from typing import Any, Dict, List
import gdsfactory as gf
from gdsfactory.cell import cell
from gdsfactory.component import Component
from gdsfactory.grid import grid, grid_with_text
from gdsfactory.pack import pack
from gdsfactory.types import CellSpec, ComponentSpec, Optional
@cell
def pack... | import itertools as it
from typing import Any, Dict, List
import gdsfactory as gf
from gdsfactory.cell import cell
from gdsfactory.component import Component
from gdsfactory.grid import grid, grid_with_text
from gdsfactory.pack import pack
from gdsfactory.types import CellSpec, ComponentSpec, Optional
@cell
def pack... | en | 0.700334 | Packs a component DOE (Design of Experiment) using pack. Args: doe: function to return Components. settings: component settings. do_permutations: for each setting. function: for the component (add padding, grating couplers ...) keyword Args: spacing: Minimum distance be... | 2.23235 | 2 |
scripts/usefullFunctions.py | pete-usds/opal | 16 | 6633001 | <reponame>pete-usds/opal<gh_stars>10-100
from opal.settings import BASE_DIR
import logging
from rest_framework.renderers import JSONRenderer
import json
import os
def startLogging():
logging.basicConfig( # filename=logFile,
filemode='w',
format='%(name)s - %(levelname)s - %(message)s',
lev... | from opal.settings import BASE_DIR
import logging
from rest_framework.renderers import JSONRenderer
import json
import os
def startLogging():
logging.basicConfig( # filename=logFile,
filemode='w',
format='%(name)s - %(levelname)s - %(message)s',
level=logging.DEBUG
)
def addControlsTo... | en | 0.73372 | # filename=logFile, :param group_name: The name of a new group of controls. Cold be a new baseline or a common set of controls such as those addressed by a particular component :param controls: a list object contining one or more system_control objects # These are some useful functions for cleaning up data after an... | 2.336493 | 2 |
config.example.py | Cyanoxygen/arcaea-mp | 3 | 6633002 | <filename>config.example.py
threshold = 200 # in second
| <filename>config.example.py
threshold = 200 # in second
| en | 0.976727 | # in second | 1.160527 | 1 |
amass/commands/remove/source/__init__.py | sayan-rc/amass | 0 | 6633003 | import amass
class Command(amass.commands.Command):
is_command = False
def __init__(self):
amass.commands.Command.__init__(self)
self.file = __file__ | import amass
class Command(amass.commands.Command):
is_command = False
def __init__(self):
amass.commands.Command.__init__(self)
self.file = __file__ | none | 1 | 2.213302 | 2 | |
fintech/fda/views.py | fpark7/cs3240-s17-team31 | 0 | 6633004 | <gh_stars>0
from django.shortcuts import render
from django.shortcuts import render
from django.shortcuts import render
from django.contrib.auth.models import User
from django.contrib.auth import login, authenticate, logout
from django.db import models
from django.contrib.auth.models import Group, Permission
from djang... | from django.shortcuts import render
from django.shortcuts import render
from django.shortcuts import render
from django.contrib.auth.models import User
from django.contrib.auth import login, authenticate, logout
from django.db import models
from django.contrib.auth.models import Group, Permission
from django.contrib.au... | en | 0.877782 | # actually does nothing # ADD INDUSTRY ONCE WE UPDATE THE MODEL AND FORMS # I am also passing report.id to be smart # content will be downloaded upon request in the client fda later | 2.104918 | 2 |
NoiseAdder.py | neu-spiral/GraphMatching | 0 | 6633005 | <filename>NoiseAdder.py<gh_stars>0
import numpy as np
import pickle
import random
import argparse
if __name__=="__main__":
parser = argparse.ArgumentParser(description = 'Graph Preprocessor .',formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('graph',help = 'File containing the graph')... | <filename>NoiseAdder.py<gh_stars>0
import numpy as np
import pickle
import random
import argparse
if __name__=="__main__":
parser = argparse.ArgumentParser(description = 'Graph Preprocessor .',formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('graph',help = 'File containing the graph')... | en | 0.798045 | #generate weights | 2.726728 | 3 |
pypy/module/imp/importing.py | olliemath/pypy | 0 | 6633006 | """
Implementation of the interpreter-level default import logic.
"""
import sys, os, stat, re, platform
from pypy.interpreter.module import Module, init_extra_module_attrs
from pypy.interpreter.gateway import interp2app, unwrap_spec
from pypy.interpreter.typedef import TypeDef, generic_new_descr
from pypy.interprete... | """
Implementation of the interpreter-level default import logic.
"""
import sys, os, stat, re, platform
from pypy.interpreter.module import Module, init_extra_module_attrs
from pypy.interpreter.gateway import interp2app, unwrap_spec
from pypy.interpreter.typedef import TypeDef, generic_new_descr
from pypy.interprete... | en | 0.810904 | Implementation of the interpreter-level default import logic. # see also pypy_incremental_magic in interpreter/pycode.py for the magic # version number stored inside pyc files. # darwin? # this is an implicit requirement of importlib on Windows! # A minimal version, that can only import builtin and lib_pypy modules! # ... | 2.060578 | 2 |
data-hub-api/apps/migrator/tests/queries/test_all.py | uktrade/data-hub-api-old | 0 | 6633007 | import datetime
from django.utils import timezone
from reversion import revisions as reversion
from reversion.models import Revision, Version
from migrator.tests.models import SimpleObj
from migrator.tests.base import BaseMockedCDMSRestApiTestCase
from cdms_api.tests.rest.utils import mocked_cdms_list
class AllTe... | import datetime
from django.utils import timezone
from reversion import revisions as reversion
from reversion.models import Revision, Version
from migrator.tests.models import SimpleObj
from migrator.tests.base import BaseMockedCDMSRestApiTestCase
from cdms_api.tests.rest.utils import mocked_cdms_list
class AllTe... | en | 0.738834 | Klass.objects.all() will: - hit cdms to get the objs - create or update local objs if necessary - return local objs In this case: - cdms-pk1 does not exist in local => - local obj should get created - revisions created ... | 2.043074 | 2 |
main.py | FajarTheGGman/RoseKiller | 1 | 6633008 | import os
from bs4 import BeautifulSoup as bs
import urllib3 as url
from content.xss import *
from content.dork import *
from content.sc import *
class Main:
def banner():
print(" ';.")
print(" .---., \ [!] Report Error To My Social Media :)")
print(" []... | import os
from bs4 import BeautifulSoup as bs
import urllib3 as url
from content.xss import *
from content.dork import *
from content.sc import *
class Main:
def banner():
print(" ';.")
print(" .---., \ [!] Report Error To My Social Media :)")
print(" []... | none | 1 | 2.95346 | 3 | |
Converter/OpenVINO/Tests/ModulesTest.py | EmilPi/PuzzleLib | 52 | 6633009 | import numpy as np
from PuzzleLib import Config
Config.backend = Config.Backend.intel
Config.globalEvalMode = True
from PuzzleLib.Backend import gpuarray
from PuzzleLib.Containers.Sequential import Sequential
from PuzzleLib.Containers.Parallel import Parallel
from PuzzleLib.Modules.BatchNorm import BatchNorm
from ... | import numpy as np
from PuzzleLib import Config
Config.backend = Config.Backend.intel
Config.globalEvalMode = True
from PuzzleLib.Backend import gpuarray
from PuzzleLib.Containers.Sequential import Sequential
from PuzzleLib.Containers.Parallel import Parallel
from PuzzleLib.Modules.BatchNorm import BatchNorm
from ... | none | 1 | 2.018336 | 2 | |
build/update-olm.py | davidvossel/node-maintenance-operator | 0 | 6633010 | #!/usr/bin/env python3
import logging
import sys
import yaml
_ANNOTATIONS = {
'categories': 'OpenShift Optional',
'containerImage': 'quay.io/kubevirt/node-maintenance-operator',
'repository': 'https://github.com/kubevirt/node-maintenance-operator',
'description': \
'Node-maintenance-operator ... | #!/usr/bin/env python3
import logging
import sys
import yaml
_ANNOTATIONS = {
'categories': 'OpenShift Optional',
'containerImage': 'quay.io/kubevirt/node-maintenance-operator',
'repository': 'https://github.com/kubevirt/node-maintenance-operator',
'description': \
'Node-maintenance-operator ... | en | 0.467461 | #!/usr/bin/env python3 # keep going! | 1.777788 | 2 |
test_proj/media_library/tests/test_managers.py | Querschlag/django-video-encoding | 116 | 6633011 | <reponame>Querschlag/django-video-encoding
import pytest
from django.contrib.contenttypes.models import ContentType
from ..models import Format
@pytest.fixture
def video_format(local_video):
return Format.objects.create(
object_id=local_video.pk,
content_type=ContentType.objects.get_for_model(loc... | import pytest
from django.contrib.contenttypes.models import ContentType
from ..models import Format
@pytest.fixture
def video_format(local_video):
return Format.objects.create(
object_id=local_video.pk,
content_type=ContentType.objects.get_for_model(local_video),
field_name='file',
... | none | 1 | 2.233856 | 2 | |
dashlib/mnb_maketx.py | chaeplin/dash-mnb | 18 | 6633012 | <reponame>chaeplin/dash-mnb
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '.'))
from decimal import Decimal
from config import *
from mnb_misc import *
from mnb_rpc import *
from mnb_mnconf import *
from mnb_hwwallet import *
def print_balance(mn_config, have_unconfirmed_tx):
nee... | import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '.'))
from decimal import Decimal
from config import *
from mnb_misc import *
from mnb_rpc import *
from mnb_mnconf import *
from mnb_hwwallet import *
def print_balance(mn_config, have_unconfirmed_tx):
need_wallet_rescan = False
... | en | 0.583712 | #listunspent = get_listunspent(6, 999999999, collateral_address, access) #unspent_amount = m['amount'] # for testing #mature_confirmation = 10 # trezor and keepkey # make input # after dip001 # todo : use estimatesmartfee # old #txsizefee = round((len(inputs) * 148 + 33 - 10) / 1000) * min_fee # minimal fee if input le... | 2.239682 | 2 |
python/venv/lib/python2.7/site-packages/keystoneauth1/tests/unit/loading/test_conf.py | sjsucohort6/openstack | 0 | 6633013 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | en | 0.853583 | # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t... | 1.873384 | 2 |
iblvideo/tests/test_choiceworld.py | int-brain-lab/iblvideo | 4 | 6633014 | import shutil
import numpy as np
import pandas as pd
from one.api import ONE
from iblvideo.choiceworld import dlc
from iblvideo.weights import download_weights
from iblvideo.tests import _download_dlc_test_data
from iblvideo import __version__
def test_dlc(version=__version__):
one = ONE()
test_data = _dow... | import shutil
import numpy as np
import pandas as pd
from one.api import ONE
from iblvideo.choiceworld import dlc
from iblvideo.weights import download_weights
from iblvideo.tests import _download_dlc_test_data
from iblvideo import __version__
def test_dlc(version=__version__):
one = ONE()
test_data = _dow... | en | 0.901501 | # only compare entries with likelihood over 0.9 | 2.445482 | 2 |
training/tokenisation.py | dice-group/NETL-Automatic-Topic-Labelling- | 176 | 6633015 | <reponame>dice-group/NETL-Automatic-Topic-Labelling-<gh_stars>100-1000
"""
Author: <NAME>
Date: October 2016
File: tokenisation.py
It takes in processed xml dump extraced by WikiExtractor and tokenises it using standford-parser for tokenization.
You can use any of the below URL to downloa... | """
Author: <NAME>
Date: October 2016
File: tokenisation.py
It takes in processed xml dump extraced by WikiExtractor and tokenises it using standford-parser for tokenization.
You can use any of the below URL to download it and unzip it if want to run on your own.
http://nlp.stanford.edu/... | en | 0.827296 | Author: <NAME> Date: October 2016 File: tokenisation.py It takes in processed xml dump extraced by WikiExtractor and tokenises it using standford-parser for tokenization. You can use any of the below URL to download it and unzip it if want to run on your own. http://nlp.stanford.edu/softw... | 2.935252 | 3 |
Skill_Development_Center/Individual_Assignments/Prethvi_Raj/Task_3.py | Pirouz-Nourian/earthy_18 | 1 | 6633016 | <reponame>Pirouz-Nourian/earthy_18
import Rhino.Geometry as rg
import math as math
import rhinoscriptsyntax as rs
Bbox =S.GetBoundingBox(True)
W = Bbox.Diagonal.X
L = Bbox.Diagonal.Y
H = Bbox.Diagonal.Z
#print(W)
XC = int(math.ceil(W/xS))
YC = int(math.ceil(L/yS))
ZC = int(math.ceil(H/zS))
points = []
distList = []
... | import Rhino.Geometry as rg
import math as math
import rhinoscriptsyntax as rs
Bbox =S.GetBoundingBox(True)
W = Bbox.Diagonal.X
L = Bbox.Diagonal.Y
H = Bbox.Diagonal.Z
#print(W)
XC = int(math.ceil(W/xS))
YC = int(math.ceil(L/yS))
ZC = int(math.ceil(H/zS))
points = []
distList = []
print(Bbox)
bPoint = Bbox.Min
print... | ru | 0.191288 | #print(W) #print(distList) | 2.279289 | 2 |
tracker/app/models/ddr.py | skielred/FairyJokeAPI | 3 | 6633017 | <reponame>skielred/FairyJokeAPI
import enum
import sqlalchemy as sa
from sqlalchemy import orm
from app import db
from app.utils.badges import FCBadges
from app.utils.enumerable import Enumerable
class DDRLocalChart(db.IdMixin, db.Base):
title = sa.Column(sa.String)
artist = sa.Column(sa.String)
step_art... | import enum
import sqlalchemy as sa
from sqlalchemy import orm
from app import db
from app.utils.badges import FCBadges
from app.utils.enumerable import Enumerable
class DDRLocalChart(db.IdMixin, db.Base):
title = sa.Column(sa.String)
artist = sa.Column(sa.String)
step_artist = sa.Column(sa.String)
d... | en | 0.788646 | # Only shows 1/4s # Only shows 1/8s | 2.217332 | 2 |
src/setup.py | akiyoko/django-simple-serializer | 180 | 6633018 | <filename>src/setup.py
import codecs
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def read(fname):
return codecs.open(os.path.join(os.path.dirname(__file__), fname)).read()
NAME = "django-simple-serializer"
PACKAGES = ["dss", ]
DESCRIPTIO... | <filename>src/setup.py
import codecs
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def read(fname):
return codecs.open(os.path.join(os.path.dirname(__file__), fname)).read()
NAME = "django-simple-serializer"
PACKAGES = ["dss", ]
DESCRIPTIO... | none | 1 | 1.654601 | 2 | |
Scripts/simulation/story_progression/story_progression_action_career.py | velocist/TS4CheatsInfo | 0 | 6633019 | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\story_progression\story_progression_action_career.py
# Compiled at: 2015-05-01 22:45:36
# Size of so... | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\story_progression\story_progression_action_career.py
# Compiled at: 2015-05-01 22:45:36
# Size of so... | en | 0.510533 | # uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Server\story_progression\story_progression_action_career.py # Compiled at: 2015-05-01 22:45:36 # Size of so... | 1.854488 | 2 |
get_top_hits.py | beepscore/websearcher | 0 | 6633020 | <reponame>beepscore/websearcher
#!/usr/bin/env python3
from websearcher import top_hits
"""
Search words in input file. Use command line arguments.
"""
top_hits = top_hits.TopHits("@./data/input/top_hit_args.txt")
# top_hits_from_file_to_file writes to file, doesn't return anything
top_hits.top_hits_from_file_to_fi... | #!/usr/bin/env python3
from websearcher import top_hits
"""
Search words in input file. Use command line arguments.
"""
top_hits = top_hits.TopHits("@./data/input/top_hit_args.txt")
# top_hits_from_file_to_file writes to file, doesn't return anything
top_hits.top_hits_from_file_to_file() | en | 0.750986 | #!/usr/bin/env python3 Search words in input file. Use command line arguments. # top_hits_from_file_to_file writes to file, doesn't return anything | 2.90273 | 3 |
pydynamo_brain/pydynamo_brain/test/uiPunctaTest.py | ubcbraincircuits/pyDynamo | 4 | 6633021 | import os
import time
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtCore import Qt, QPoint
from pydynamo_brain.ui import DynamoWindow
import pydynamo_brain.util as util
from pydynamo_brain.util.testableFilePicker import setNextTestPaths
from pydynamo_brain.files import fullStateToString, stringToFullState
def _n... | import os
import time
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtCore import Qt, QPoint
from pydynamo_brain.ui import DynamoWindow
import pydynamo_brain.util as util
from pydynamo_brain.util.testableFilePicker import setNextTestPaths
from pydynamo_brain.files import fullStateToString, stringToFullState
def _n... | en | 0.815078 | # Click to open new stack: # Wait til window is ready: # Empty tree, no puncta # Enter puncta mode # Draw the point # Move the point # Resize the point # Draw a second point: # Delete the first point by clicking on its boundary: # ... only the second point left # Save and load to verify | 2.267273 | 2 |
go/bootstrap.py | allaparthi/monorail | 0 | 6633022 | #!/usr/bin/env vpython
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Prepares a local hermetic Go installation.
- Downloads and unpacks the Go toolset in ../../golang.
- Downloads and installs Glide ... | #!/usr/bin/env vpython
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Prepares a local hermetic Go installation.
- Downloads and unpacks the Go toolset in ../../golang.
- Downloads and installs Glide ... | en | 0.828993 | #!/usr/bin/env vpython # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. Prepares a local hermetic Go installation. - Downloads and unpacks the Go toolset in ../../golang. - Downloads and installs Glide (use... | 1.79898 | 2 |
Python/Buch_ATBS/Teil_2/Kapitel_13_Arbeiten_mit_Word_und_PDF_Dokumenten/10_kapitel_13_repetitionsfragen.py | Apop85/Scripts | 0 | 6633023 | # 10_kapitel_13_repetitionsfragen.py
import re
max_text_length=70
max_text_delta=20
def output(title, string):
print('╔'+''.center(max_text_length+8, '═')+'╗')
print('║ '+title.center(max_text_length+7).upper()+'║')
print('╠'+''.center(max_text_length+8, '═')+'╣')
string=string+' '*max_text_length
... | # 10_kapitel_13_repetitionsfragen.py
import re
max_text_length=70
max_text_delta=20
def output(title, string):
print('╔'+''.center(max_text_length+8, '═')+'╗')
print('║ '+title.center(max_text_length+7).upper()+'║')
print('╠'+''.center(max_text_length+8, '═')+'╣')
string=string+' '*max_text_length
... | de | 0.283335 | # 10_kapitel_13_repetitionsfragen.py | 3.096758 | 3 |
aps/tokenizer/__init__.py | ishine/aps | 117 | 6633024 | from .base import Tokenizer
from .subword import SubwordTokenizer
from .word import WordTokenizer, CharTokenizer
| from .base import Tokenizer
from .subword import SubwordTokenizer
from .word import WordTokenizer, CharTokenizer
| none | 1 | 1.222238 | 1 | |
registration/admin.py | AVS18/Hospital-Management-System | 0 | 6633025 | <reponame>AVS18/Hospital-Management-System<gh_stars>0
from django.contrib import admin
from .models import User
from .models import Profile
from .models import Appointments
from .models import Prescription
from .models import Invoice
class Customize_userreges(admin.ModelAdmin):
list_display=['first_name','last_nam... | from django.contrib import admin
from .models import User
from .models import Profile
from .models import Appointments
from .models import Prescription
from .models import Invoice
class Customize_userreges(admin.ModelAdmin):
list_display=['first_name','last_name','username','email','profession']
list_filter=([... | none | 1 | 1.87858 | 2 | |
polybar/.config/polybar/taskwarrior/rofi.py | stanham33/dotfiles | 0 | 6633026 | <reponame>stanham33/dotfiles
#
# python-rofi
#
# The MIT License
#
# Copyright (c) 2016 <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including witho... | #
# python-rofi
#
# The MIT License
#
# Copyright (c) 2016 <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to... | en | 0.781453 | # # python-rofi # # The MIT License # # Copyright (c) 2016 <NAME> <<EMAIL>> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to... | 2.336635 | 2 |
decompile_all_EO3_ai.py | LumenTheFairy/Etrian-Odyssey-Data-Interpreter | 4 | 6633027 | <gh_stars>1-10
#!/usr/bin/python
# coding: utf-8
# Decompiles all AI files, naming, to the extent possible, skills
# and the entities that use each AI file (if any)
# assumes directory structure:
# ./EO3/
# AI/
# BtlBSTScrFileTable.tbl
# BtlNPCScrFileTable.tbl
# BtlScrFileTable.tbl
# *.bf
#... | #!/usr/bin/python
# coding: utf-8
# Decompiles all AI files, naming, to the extent possible, skills
# and the entities that use each AI file (if any)
# assumes directory structure:
# ./EO3/
# AI/
# BtlBSTScrFileTable.tbl
# BtlNPCScrFileTable.tbl
# BtlScrFileTable.tbl
# *.bf
# Skills/
# ... | en | 0.672329 | #!/usr/bin/python # coding: utf-8 # Decompiles all AI files, naming, to the extent possible, skills # and the entities that use each AI file (if any) # assumes directory structure: # ./EO3/ # AI/ # BtlBSTScrFileTable.tbl # BtlNPCScrFileTable.tbl # BtlScrFileTable.tbl # *.bf # Skills/ # ... | 2.282127 | 2 |
pre-processing/prepare_data.py | ocastx/deepspeech-german | 0 | 6633028 | <reponame>ocastx/deepspeech-german
#! /usr/bin/env python
"""
1. Load all corpora where a path is given.
2. Clean transcriptions.
3. Merge all corpora
4. Create Train/Dev/Test splits
5. Export for DeepSpeech
"""
import os
import sys
sys.path.append(os.path.abspath(os.path.join(__file__, os.path.pardir)))
import arg... | #! /usr/bin/env python
"""
1. Load all corpora where a path is given.
2. Clean transcriptions.
3. Merge all corpora
4. Create Train/Dev/Test splits
5. Export for DeepSpeech
"""
import os
import sys
sys.path.append(os.path.abspath(os.path.join(__file__, os.path.pardir)))
import argparse
import audiomate
from audiom... | en | 0.518926 | #! /usr/bin/env python 1. Load all corpora where a path is given. 2. Clean transcriptions. 3. Merge all corpora 4. Create Train/Dev/Test splits 5. Export for DeepSpeech | 2.453347 | 2 |
api/urls.py | prakash3720/django-rest | 0 | 6633029 | <filename>api/urls.py
from django.urls import path,include
from rest_framework.routers import DefaultRouter
from api import views
router=DefaultRouter()
router.register('profile',views.UserProfileViewSet)
router.register('todo',views.UserProfileTodoViewSet)
urlpatterns=[
path('login/',views.UserLoginApiView.as_vi... | <filename>api/urls.py
from django.urls import path,include
from rest_framework.routers import DefaultRouter
from api import views
router=DefaultRouter()
router.register('profile',views.UserProfileViewSet)
router.register('todo',views.UserProfileTodoViewSet)
urlpatterns=[
path('login/',views.UserLoginApiView.as_vi... | none | 1 | 2.121861 | 2 | |
agregator/mainpage/models.py | tarasen1/Django-Agregator-Site | 0 | 6633030 | <filename>agregator/mainpage/models.py
from django.db import models
from django.core.validators import MaxValueValidator, MinValueValidator
from django.contrib.auth.models import User
class Room(models.Model):
class Meta():
db_table = 'rooms'
def __str__(self):
return self.room_name
room_user = models.Forei... | <filename>agregator/mainpage/models.py
from django.db import models
from django.core.validators import MaxValueValidator, MinValueValidator
from django.contrib.auth.models import User
class Room(models.Model):
class Meta():
db_table = 'rooms'
def __str__(self):
return self.room_name
room_user = models.Forei... | none | 1 | 2.184784 | 2 | |
src/tratamientos/migrations/0003_auto_20160515_2028.py | mava-ar/sgk | 0 | 6633031 | <gh_stars>0
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-15 23:28
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('tratamientos', '0002_auto_2... | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-15 23:28
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('tratamientos', '0002_auto_20160510_0022... | en | 0.837737 | # -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-05-15 23:28 | 1.721824 | 2 |
pcp_sdn_source/pcp_sdn/dphelper.py | kamilburda/pcp-sdn | 2 | 6633032 | """
This module contains datapath-related functions for easier management.
"""
from collections import OrderedDict
#===============================================================================
def get_mac_addr_from_datapath(datapath):
"""
Return the MAC address from the datapath ID.
According to OpenFlo... | """
This module contains datapath-related functions for easier management.
"""
from collections import OrderedDict
#===============================================================================
def get_mac_addr_from_datapath(datapath):
"""
Return the MAC address from the datapath ID.
According to OpenFlo... | en | 0.687146 | This module contains datapath-related functions for easier management. #=============================================================================== Return the MAC address from the datapath ID. According to OpenFlow switch specification, the lower 48 bits of the datapath ID contains the MAC address. #========... | 2.593593 | 3 |
ndispers/media/crystals/_betaBBO_Tamosauskas2018.py | akihiko-shimura/ndispers | 4 | 6633033 | <reponame>akihiko-shimura/ndispers<gh_stars>1-10
import sympy
from ndispers._baseclass import Medium, wl, phi, theta, T, pi
from ndispers.helper import vars2
class BetaBBO(Medium):
"""
beta-BBO (beta-Ba B_2 O_4) crystal
- Point group : 3m
- Crystal system : Trigonal
- Dielectic principal axis, z /... | import sympy
from ndispers._baseclass import Medium, wl, phi, theta, T, pi
from ndispers.helper import vars2
class BetaBBO(Medium):
"""
beta-BBO (beta-Ba B_2 O_4) crystal
- Point group : 3m
- Crystal system : Trigonal
- Dielectic principal axis, z // c-axis (x, y-axes are arbitrary)
- Negative... | en | 0.56011 | beta-BBO (beta-Ba B_2 O_4) crystal - Point group : 3m - Crystal system : Trigonal - Dielectic principal axis, z // c-axis (x, y-axes are arbitrary) - Negative uniaxial, with optic axis parallel to z-axis - Tranparency range : 0.19 to 2.6 um Dispersion formula for refractive index -----... | 2.508003 | 3 |
eslib.py | sweverett/CluStR | 6 | 6633034 | <reponame>sweverett/CluStR<gh_stars>1-10
import linmix # Kelly algorithm package ported to Python
import numpy as np
import numpy.random as npr
from scipy import stats
import scipy.optimize as sop
from inputParameters import beta1, beta2
npr.seed(800)
def scatter_cal(x,y,slope,intercept,dof):
sig2 = sum((np.array(y... | import linmix # Kelly algorithm package ported to Python
import numpy as np
import numpy.random as npr
from scipy import stats
import scipy.optimize as sop
from inputParameters import beta1, beta2
npr.seed(800)
def scatter_cal(x,y,slope,intercept,dof):
sig2 = sum((np.array(y) - (slope*np.array(x)+intercept))**2) / ... | en | 0.632181 | # Kelly algorithm package ported to Python # First order approximation # First order approximation # calculate the true intercept, slope, and scatter of inverse of scaling # relation assuming beta1 and beta2 is known (E14 notation) #sig / slope #OK #sig / slope #Z = gSig / gSlope #initial guess #Z = sop.fsolve(solveFor... | 2.540895 | 3 |
graphene/types/field.py | sebdiem/graphene | 1 | 6633035 | <gh_stars>1-10
import inspect
from collections import Mapping, OrderedDict
from functools import partial
from .argument import Argument, to_arguments
from .mountedtype import MountedType
from .structures import NonNull
from .unmountedtype import UnmountedType
from .utils import get_type
base_type = type
def source_... | import inspect
from collections import Mapping, OrderedDict
from functools import partial
from .argument import Argument, to_arguments
from .mountedtype import MountedType
from .structures import NonNull
from .unmountedtype import UnmountedType
from .utils import get_type
base_type = type
def source_resolver(source... | en | 0.759891 | # Check if name is actually an argument of the field # Check if source is actually an argument of the field | 2.447335 | 2 |
wfdb/readwrite/records.py | Chirayu-sopho/Sleep_Disorder_Classification | 0 | 6633036 | <reponame>Chirayu-sopho/Sleep_Disorder_Classification<gh_stars>0
# For wrheader(), all fields must be already filled in and cohesive with one another other. The signals field will not be used.
# For wrsamp(), the field to use will be d_signals (which is allowed to be empty for 0 channel records).
# set_p_features and s... | # For wrheader(), all fields must be already filled in and cohesive with one another other. The signals field will not be used.
# For wrsamp(), the field to use will be d_signals (which is allowed to be empty for 0 channel records).
# set_p_features and set_d_features use characteristics of the p_signals or d_signals f... | en | 0.789103 | # For wrheader(), all fields must be already filled in and cohesive with one another other. The signals field will not be used. # For wrsamp(), the field to use will be d_signals (which is allowed to be empty for 0 channel records). # set_p_features and set_d_features use characteristics of the p_signals or d_signals f... | 2.573053 | 3 |
dipper_methods.py | dirac-institute/ZTF_Boyajian | 2 | 6633037 | import numpy as np
from scipy.ndimage import minimum_filter1d
def setup_pyximport():
import pyximport
pyximport.install(reload_support=True, setup_args={'include_dirs': np.get_include()})
class cython_function():
def __init__(self, module, name):
self.module = module
self.name = name
... | import numpy as np
from scipy.ndimage import minimum_filter1d
def setup_pyximport():
import pyximport
pyximport.install(reload_support=True, setup_args={'include_dirs': np.get_include()})
class cython_function():
def __init__(self, module, name):
self.module = module
self.name = name
... | en | 0.895893 | # Don't return the module so that each node has to recompile it itself. a docstring # moved into here for lack of better place # Convert everything to numpy arrays and sort them by MJD # Mask out bad or repeated observations. # In the oct19 data, some observations have a magerr of 0 and aren't flagged. # This causes a ... | 2.332965 | 2 |
data/sampling/sample_cord-19.py | dartar/habeas-corpus | 5 | 6633038 | import csv
import pandas
import random
SAMPLE_COUNT = 100
i = 0
with open('../cord-19/CORD19_software_mentions.csv', 'r') as csv_file:
csv_reader = csv.reader(csv_file)
row_count = sum(1 for row in csv_reader)
rand_ints = random.sample(range(1, row_count), SAMPLE_COUNT)
with open('output.csv', 'w') as... | import csv
import pandas
import random
SAMPLE_COUNT = 100
i = 0
with open('../cord-19/CORD19_software_mentions.csv', 'r') as csv_file:
csv_reader = csv.reader(csv_file)
row_count = sum(1 for row in csv_reader)
rand_ints = random.sample(range(1, row_count), SAMPLE_COUNT)
with open('output.csv', 'w') as... | none | 1 | 3.005735 | 3 | |
H3/bundle/q1-starter.py | Cauchemare/CS224W_2020_Solutions | 1 | 6633039 | import snap
import numpy as np
import matplotlib.pyplot as plt
def load_graph(name):
'''
Helper function to load graphs.
Use "epinions" for Epinions graph and "email" for Email graph.
Check that the respective .txt files are in the same folder as this script;
if not, change the paths below as requi... | import snap
import numpy as np
import matplotlib.pyplot as plt
def load_graph(name):
'''
Helper function to load graphs.
Use "epinions" for Epinions graph and "email" for Email graph.
Check that the respective .txt files are in the same folder as this script;
if not, change the paths below as requi... | en | 0.421461 | Helper function to load graphs. Use "epinions" for Epinions graph and "email" for Email graph. Check that the respective .txt files are in the same folder as this script; if not, change the paths below as required. You will have to run the inward and outward BFS trees for the respective nodes and reaso... | 3.048051 | 3 |
cifar/step2/main_finetune_model_decomposed.py | chatzikon/DNN-COMPRESSION | 9 | 6633040 | from __future__ import print_function
import argparse
import numpy as np
import os
import shutil
import torchnet as tnt
import time
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
from torch.optim.lr_scheduler import MultiStepLR
import random
import torch.nn as nn
imp... | from __future__ import print_function
import argparse
import numpy as np
import os
import shutil
import torchnet as tnt
import time
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
from torch.optim.lr_scheduler import MultiStepLR
import random
import torch.nn as nn
imp... | en | 0.798905 | # Training settings # sum up batch loss # get the index of the max log-probability #load the compressed network #sometimes there is a problem with AvgPool2d of the loaded model, if this problem occur, uncomment this line #model.avgpool = nn.AvgPool2d(kernel_size=8, stride=8, padding=0) | 2.239001 | 2 |
src/programy/extensions/admin/client.py | whackur/chatbot | 2 | 6633041 | """
Copyright (c) 2016-2018 <NAME> http://www.keithsterling.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, m... | """
Copyright (c) 2016-2018 <NAME> http://www.keithsterling.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, m... | en | 0.783776 | Copyright (c) 2016-2018 <NAME> http://www.keithsterling.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge... | 1.966958 | 2 |
src/BlenderClass/importSTL.py | kazulagi/plantFEM | 21 | 6633042 | import bpy
bl_info = {
"name" : "import_STL_object", # プラグイン名
"author" : "<NAME>", # 作者
"version" : (0,1), # プラグインのバージョン
"blender" : (2, 7, 9), # プラグインが動作するBlenderのバージョン
"location" : "3DVIEW > ADD > MESH ", # Blender内部でのプラグインの位置づけ
"de... | import bpy
bl_info = {
"name" : "import_STL_object", # プラグイン名
"author" : "<NAME>", # 作者
"version" : (0,1), # プラグインのバージョン
"blender" : (2, 7, 9), # プラグインが動作するBlenderのバージョン
"location" : "3DVIEW > ADD > MESH ", # Blender内部でのプラグインの位置づけ
"de... | ja | 0.981788 | # プラグイン名 # 作者 # プラグインのバージョン # プラグインが動作するBlenderのバージョン # Blender内部でのプラグインの位置づけ # プラグインの説明 # プラグインの説明が存在するWikiページのURL # Blender Developer OrgのスレッドURL # プラグインのカテゴリ名 ## オブジェクト(ICO球)を生成するオペレーション #class importSTL(bpy.types.Operator): # # bl_idname = "object.create_object_STL" # bl_label = "import_STL_obj" # bl_descr... | 2.191201 | 2 |
desktop/core/ext-py/Django-1.2.3/django/middleware/csrf.py | digideskio/hortonworks-sandbox | 19 | 6633043 | <reponame>digideskio/hortonworks-sandbox<filename>desktop/core/ext-py/Django-1.2.3/django/middleware/csrf.py
"""
Cross Site Request Forgery Middleware.
This module provides a middleware that implements protection
against request forgeries from other sites.
"""
import itertools
import re
import random
from django.con... | """
Cross Site Request Forgery Middleware.
This module provides a middleware that implements protection
against request forgeries from other sites.
"""
import itertools
import re
import random
from django.conf import settings
from django.core.urlresolvers import get_callable
from django.utils.cache import patch_vary... | en | 0.883026 | Cross Site Request Forgery Middleware. This module provides a middleware that implements protection against request forgeries from other sites. # Use the system (hardware-based) random number generator if it exists. # 2 << 63 Returns the view to be used for CSRF rejections Returns the the CSRF token required for a POS... | 2.375316 | 2 |
unittests/transfer_ownership_tester.py | asford/pyplusplus | 3 | 6633044 | <reponame>asford/pyplusplus
# Copyright 2004-2008 <NAME>.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import os
import sys
import unittest
import fundamental_tester_base
from pyplusplus import code_creators
fro... | # Copyright 2004-2008 <NAME>.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import os
import sys
import unittest
import fundamental_tester_base
from pyplusplus import code_creators
from pyplusplus import function... | en | 0.302287 | # Copyright 2004-2008 <NAME>. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) if (this->m_pyobj) { //Py_DECREF(this->m_pyobj); this->m_pyobj = 0; } if( !this->m_pyobj) { this->m_pyobj = boost::py... | 1.869387 | 2 |
ex03/hello.py | Juju-62q/docker-handson | 1 | 6633045 | <filename>ex03/hello.py<gh_stars>1-10
print ("Hello Dockerfile COPY command!")
| <filename>ex03/hello.py<gh_stars>1-10
print ("Hello Dockerfile COPY command!")
| none | 1 | 1.28737 | 1 | |
src/valid_num.py | qtKite/leetcode-submissions | 0 | 6633046 | def isNumber(s):
# can only contain 1 e
# only one decimal
# no other chars allowed
# only one sign bit which is the left most
# can contain spaces on left and right and not in between
s = s.strip()
decimal_count = 0
e_count = 0
e_pos = 0
sign_count = 0
sign_pos = 0
inde... | def isNumber(s):
# can only contain 1 e
# only one decimal
# no other chars allowed
# only one sign bit which is the left most
# can contain spaces on left and right and not in between
s = s.strip()
decimal_count = 0
e_count = 0
e_pos = 0
sign_count = 0
sign_pos = 0
inde... | en | 0.904763 | # can only contain 1 e # only one decimal # no other chars allowed # only one sign bit which is the left most # can contain spaces on left and right and not in between | 3.655346 | 4 |
mmtbx/disorder/analyze_model.py | hbrunie/cctbx_project | 2 | 6633047 | <filename>mmtbx/disorder/analyze_model.py<gh_stars>1-10
from __future__ import absolute_import, division, print_function
from mmtbx.disorder import backbone
from scitbx.array_family import flex
from scitbx.matrix import col
from libtbx.str_utils import format_value as fv
from libtbx import Auto, slots_getstate_setstat... | <filename>mmtbx/disorder/analyze_model.py<gh_stars>1-10
from __future__ import absolute_import, division, print_function
from mmtbx.disorder import backbone
from scitbx.array_family import flex
from scitbx.matrix import col
from libtbx.str_utils import format_value as fv
from libtbx import Auto, slots_getstate_setstat... | en | 0.833865 | # XXX in order to make this run in parallel over many PDB IDs, I need to cheat # slightly and substitute pickle-able objects for the original classes in # iotbx.pdb.hierarchy. Note that parent relationships will be lost in the # process. Pickle-able stand-in for iotbx.pdb.hierarchy.residue_group. Pickle-able stand-in ... | 1.837649 | 2 |
tree.py | andribas404/fluffy-palm-tree | 0 | 6633048 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Имплементация алгоритма Дейкстры с использованием Фибоначчиевых куч.
With zero dependencies (no import).
class FibonacciHeap - Фибоначчиева куча.
class Graph - Граф с вершинами и ребрами.
class AlgorithmDijkstra - Реализация алгоритма Дейкстры.
"""
class FibonacciHe... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Имплементация алгоритма Дейкстры с использованием Фибоначчиевых куч.
With zero dependencies (no import).
class FibonacciHeap - Фибоначчиева куча.
class Graph - Граф с вершинами и ребрами.
class AlgorithmDijkstra - Реализация алгоритма Дейкстры.
"""
class FibonacciHe... | ru | 0.993883 | #!/usr/bin/env python # -*- coding: utf-8 -*- Имплементация алгоритма Дейкстры с использованием Фибоначчиевых куч. With zero dependencies (no import). class FibonacciHeap - Фибоначчиева куча. class Graph - Граф с вершинами и ребрами. class AlgorithmDijkstra - Реализация алгоритма Дейкстры. Фибоначчиева куча. Heap Nod... | 3.117894 | 3 |
vgg.py | brekkanegg/cram | 1 | 6633049 | <reponame>brekkanegg/cram
import tensorflow as tf
import os, sys
import numpy as np
slim = tf.contrib.slim
class VGG():
def __init__(self, config, inputs):
self.config = config
self.image_size = inputs.image_size
self.image_shape = [self.image_size, self.image_size]
self.class_n... | import tensorflow as tf
import os, sys
import numpy as np
slim = tf.contrib.slim
class VGG():
def __init__(self, config, inputs):
self.config = config
self.image_size = inputs.image_size
self.image_shape = [self.image_size, self.image_size]
self.class_num = inputs.class_num
... | en | 0.255005 | # rgbs or rgb # self.y = tf.placeholder(tf.float32, shape=[None, self.class_num], name='y') # input # vgg16 # vgg16 # elif self.image_size == 32: # filters = [32, 64, 64, 128, 128] #, 128, 128] #256, 256, 256, 256] # strides = [2, 1, 2, 1, 2] #, 1, 2] #, 1, 2, 1, 2] # gp = 4 # hiddens = [200, 200] #, 10... | 2.513392 | 3 |
hupwatch/command.py | swistakm/hupwatch | 8 | 6633050 | # -*- coding: utf-8 -*-
import atexit
import os
import time
import signal
import logging
from hupwatch.service import Service
from hupwatch.args_parser import parse_args
logger = logging.getLogger(__name__)
delayed_exit = False
def setup_logging(verbosity):
ilogger = logging.getLogger(__name__)
if verbos... | # -*- coding: utf-8 -*-
import atexit
import os
import time
import signal
import logging
from hupwatch.service import Service
from hupwatch.args_parser import parse_args
logger = logging.getLogger(__name__)
delayed_exit = False
def setup_logging(verbosity):
ilogger = logging.getLogger(__name__)
if verbos... | en | 0.931599 | # -*- coding: utf-8 -*- # use list becasue Python 2 does not provide nonlocal statement # note: It may look like there is a small race condition between # SIGHUP and SIGCHLD but sigchld_handler will check if # current service is running so hupwatch won't quit eagerly # note: We may think about getting rid o... | 2.349403 | 2 |