Accessor to get thread-local recycler instance
768241
public static BufferRecycler instance() {
        SoftReference<BufferRecycler> ref = recyclerRef.get();

        BufferRecycler bufferRecycler;
        if (ref == null) {
            bufferRecycler = null;
        } else {
            bufferRecycler = ref.get();
        }

        if (bufferRecycler == null) {
            bufferRecycler = new BufferRecycler();
            recyclerRef.set(new SoftReference<BufferRecycler>(bufferRecycler));
        }
        return bufferRecycler;
    }
804557
def instance_thread_local(name, value = nil)
      sc = class << self
        extend DSLKit::ThreadLocal
        self
      end
      sc.thread_local name, value
      self
    end
353785
@Nullable
    private ThreadPoolExecutor unwrapThreadPoolExecutor(ExecutorService executor, Class<?> wrapper) {
        try {
            Field e = wrapper.getDeclaredField("e");
            e.setAccessible(true);
            return (ThreadPoolExecutor) e.get(executorService);
        } catch (NoSuchFieldException | IllegalAccessException e) {
            // Do nothing. We simply can't get to the underlying ThreadPoolExecutor.
        }
        return null;
    }
574253
def get_current_environ():
    """"""
    thread_local = AutomatedLoggingMiddleware.thread_local
    if hasattr(thread_local, 'request_uri'):
        request_uri = thread_local.request_uri
    else:
        request_uri = None

    if hasattr(thread_local, 'application'):
        application = thread_local.application
        application = Application.objects.get_or_create(name=application)[0]
    else:
        application = None

    if hasattr(thread_local, 'method'):
        method = thread_local.method
    else:
        method = None

    if hasattr(thread_local, 'status'):
        status = thread_local.status
    else:
        status = None

    return request_uri, application, method, status
142806
private OJBIterator getReportQueryIteratorFromQuery(Query query, ClassDescriptor cld) throws PersistenceBrokerException
    {
        RsIteratorFactory factory = ReportRsIteratorFactoryImpl.getInstance();
        OJBIterator result = getRsIteratorFromQuery(query, cld, factory);

        if (query.usePaging())
        {
            result = new PagingIterator(result, query.getStartAtIndex(), query.getEndAtIndex());
        }

        return result;
    }
115169
@Override
	public final MutableObjectIterator<T> getIterator() {
		return new MutableObjectIterator<T>()
		{
			private final int size = size();
			private int current = 0;
			
			private int currentSegment = 0;
			private int currentOffset = 0;
			
			private MemorySegment currentIndexSegment = sortIndex.get(0);

			@Override
			public T next(T target) {
				if (this.current < this.size) {
					this.current++;
					if (this.currentOffset > lastIndexEntryOffset) {
						this.currentOffset = 0;
						this.currentIndexSegment = sortIndex.get(++this.currentSegment);
					}
					
					long pointer = this.currentIndexSegment.getLong(this.currentOffset) & POINTER_MASK;
					this.currentOffset += indexEntrySize;
					
					try {
						return getRecordFromBuffer(target, pointer);
					}
					catch (IOException ioe) {
						throw new RuntimeException(ioe);
					}
				}
				else {
					return null;
				}
			}

			@Override
			public T next()
			{
				if (this.current < this.size) {
					this.current++;
					if (this.currentOffset > lastIndexEntryOffset) {
						this.currentOffset = 0;
						this.currentIndexSegment = sortIndex.get(++this.currentSegment);
					}

					long pointer = this.currentIndexSegment.getLong(this.currentOffset);
					this.currentOffset += indexEntrySize;

					try {
						return getRecordFromBuffer(pointer);
					}
					catch (IOException ioe) {
						throw new RuntimeException(ioe);
					}
				}
				else {
					return null;
				}
			}
		};
	}
1245262
@SuppressWarnings("unchecked")
  public E get(ClassLoader loader)
  {
    Object value = null;

    for (; loader != null; loader = loader.getParent()) {
      if (loader instanceof EnvironmentClassLoader) {
        EnvironmentClassLoader envLoader = (EnvironmentClassLoader) loader;

        value = envLoader.getAttribute(_varName);

        if (value != null)
          return (E) value;
      }
    }

    return _globalValue;
  }
920
def thread_data(name, value=NOTHING, ct=None):
    '''
    '''
    ct = ct or current_thread()
    if is_mainthread(ct):
        loc = process_data()
    elif not hasattr(ct, '_pulsar_local'):
        ct._pulsar_local = loc = {}
    else:
        loc = ct._pulsar_local
    if value is not NOTHING:
        if name in loc:
            if loc[name] is not value:
                raise RuntimeError(
                    '%s is already available on this thread' % name)
        else:
            loc[name] = value
    return loc.get(name)
1021308
def thread_local_property(name):
    ''''''
    name = '_thread_local_' + name

    def fget(self):
        try:
            return getattr(self, name).value
        except AttributeError:
            return None

    def fset(self, value):
        getattr(self, name).value = value

    return property(fget=fget, fset=fset)
1146936
private InvocationHandlerAdapter getInvocationHandlerAdapter(Object instance) {
        if (instance == null) {
            return null;
        }

        return mocks.get(instance);
    }
51279
@SuppressWarnings("unchecked")
    public final V get() {
        InternalThreadLocalMap threadLocalMap = InternalThreadLocalMap.get();
        Object v = threadLocalMap.indexedVariable(index);
        if (v != InternalThreadLocalMap.UNSET) {
            return (V) v;
        }

        return initialize(threadLocalMap);
    }
830098
def _find_adapter(registry, ob):
    """"""
    types = _always_object(inspect.getmro(getattr(ob, '__class__', type(ob))))
    for t in types:
        if t in registry:
            return registry[t]
1309796
private static Thread findActiveThreadByName(ThreadGroup group, String threadName) 
    {
        Thread result = null;
        
        // Get threads in 'group'
        int numThreads = group.activeCount();
        Thread[] threads = new Thread[numThreads * 2];
        numThreads = group.enumerate(threads, false);

        // Enumerate each thread in 'group'
        for (int i = 0; i < numThreads; i++) {
            if (threads[i].getName().equals(threadName)) {
                return threads[i];
            }
        }

        // Get thread subgroups of 'group'
        int numGroups = group.activeGroupCount();
        ThreadGroup[] groups = new ThreadGroup[numGroups * 2];
        numGroups = group.enumerate(groups, false);

        // Recursively visit each subgroup
        for (int i = 0; i < numGroups; i++) {
            result = findActiveThreadByName(groups[i], threadName);
            
            if (result != null) {
                break;
            }
        }
        
        return result;
    }
1234673
function _(obj, prop, options) {
    if (obj == null) {
      return obj;
    }

    return getAccessorData(obj[prop], options.context);
  }
75437
public Object get(int accessor) {
    try {
      return getValue(accessor);
    } catch (JMFException ex) {
      FFDCFilter.processException(ex, "get", "134", this);
      return null;
    }
  }
612556
@Override
    protected <T> LifecycleManager obtain(Class<T> clazz, T boundObject) throws ObjectNotAssociatedException {
        Validate.notNull(boundObject, "boundObject must not be null");
        Binding binding = STORE.get(clazz);
        if (binding == null) {
            throw new ObjectNotAssociatedException();
        }
        LifecycleManager manager = binding.get(boundObject);
        if (manager == null) {
            throw new ObjectNotAssociatedException();
        }
        return manager;
    }
1324033
function getmain(L) {
	L.rawgeti(Lua.defines.REGISTRYINDEX, Lua.defines.RIDX_MAINTHREAD);
	var _L = L.tothread(-1);
	L.pop(1);
	return _L;
}